PlayersDiagram Class Reference
+ Inheritance diagram for PlayersDiagram:

Public Member Functions

 PlayersDiagram (ServerCPtr server)
 
QPixmap pixmap () const
 

Static Public Member Functions

static QList< PlayersDiagramStyleavailableSlotStyles ()
 
static bool isNumericStyle (const QString &style)
 
static void loadImages (const QString &style)
 

Protected Types

enum  PlayerType { Bot, Human }
 

Protected Member Functions

QImage colorizePlayer (QImage image, const QColor &color)
 
void draw ()
 
void drawPictures (const QImage &image, int howMany)
 
void drawTeam (PlayerType playerType, int team, int howMany)
 
void obtainPlayerNumbers ()
 

Protected Attributes

int numBotsOnTeam [MAX_TEAMS]
 
int numBotsWithoutTeam
 
int numFreeJoinSlots
 
int numFreeSpectatorSlots
 
int numHumansOnTeam [MAX_TEAMS]
 
int numHumansWithoutTeam
 
int numSpectators
 

Static Protected Attributes

static QImage botImage
 
static QImage openImage
 
static QImage openSpecImage
 
static QImage playerImage
 
static QImage spectatorImage
 

Detailed Description

Definition at line 51 of file playersdiagram.h.

Member Function Documentation

QImage PlayersDiagram::colorizePlayer ( QImage  image,
const QColor &  color 
)
protected

Colorizes the image to color. This works is a fairly hacky way. It colorizes cyan areas only. To detect cyan it simply checks if a red component is present. If so it is not cyan.

Colorization is done by keeping the hue and saturation if the passed in color and applying the value of the color in the image.

Definition at line 85 of file playersdiagram.cpp.

void PlayersDiagram::loadImages ( const QString &  style)
static

Loads all the images used to build a diagram. Previous images will be freed. This is be used to change the diagram appearance when Configuration box indicates that such action is required.

Definition at line 181 of file playersdiagram.cpp.


The documentation for this class was generated from the following files: