Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
Player Class Reference

Data structure that holds information about players in a server. More...

#include <player.h>

List of all members.

Public Types

enum  PlayerTeam {
  TEAM_BLUE, TEAM_RED, TEAM_GREEN, TEAM_GOLD,
  TEAM_NONE = 0xFF
}

Public Member Functions

 Player (const QString &name, unsigned short score, unsigned short ping, PlayerTeam team=TEAM_NONE, bool spectator=false, bool bot=false)
const QString & name () const
short score () const
unsigned short ping () const
bool isSpectating () const
bool isBot () const
bool isTeamlessBot () const
PlayerTeam teamNum () const
bool operator== (const Player &other) const
QString nameFormatted () const
QString nameColorTagsStripped () const

Static Public Member Functions

static QString colorizeString (const QString &str, int def=4)

Protected Attributes

QString playerName
short currentScore
unsigned short currentPing
bool spectator
bool bot
PlayerTeam team

Static Protected Attributes

static const char colorChart [22][7]

Detailed Description

Data structure that holds information about players in a server.


Member Function Documentation

QString Player::colorizeString ( const QString &  str,
int  def = 4 
) [static]

Colorizes the given string. Most useful for displaying colored names.

QString Player::nameColorTagsStripped ( ) const

Seeks for characters that are not from the <32; 126> range, removes them and the characters that appear after them, then returns new string.

QString Player::nameFormatted ( ) const

Formats string into HTML format.


Member Data Documentation

const char Player::colorChart [static, protected]
Initial value:
{
        "FF91A4", 
        "D2B48C", 
        "808080", 
        "32CD32", 
        "918151", 
        "F4C430", 
        "E32636", 
        "0000FF", 
        "FF8C00", 
        "C0C0C0", 
        "FFD700", 
        "E34234", 
        "000000", 
        "4169E1", 
        "FFDEAD", 
        "465945", 
        "228b22", 
        "800000", 
        "704214", 
        "A020F0", 
        "404040", 
        "007F7F", 
}

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator