ksquares
KSquaresPlayer Class Reference
#include <ksquaresplayer.h>
Detailed Description
Player class for KSquares.Class containing All the information about a player.
Definition at line 23 of file ksquaresplayer.h.
Public Member Functions | |
| QColor | colour () const |
| void | incScore () |
| bool | isHuman () const |
| KSquaresPlayer () | |
| KSquaresPlayer (const QString &newName, const QColor &newColor, bool isPlayerHuman=true) | |
| QString | name () const |
| bool | operator< (const KSquaresPlayer &player) const |
| int | score () const |
| void | setName (const QString &newName) |
| void | setScore (int newScore) |
| QString | sig () const |
Protected Attributes | |
| QString | displaySig |
| bool | human |
| QColor | playerColour |
| QString | playerName |
| int | playerScore |
Constructor & Destructor Documentation
| KSquaresPlayer::KSquaresPlayer | ( | const QString & | newName, | |
| const QColor & | newColor, | |||
| bool | isPlayerHuman = true | |||
| ) | [inline, explicit] |
Creates a player.
- Parameters:
-
newName The displayable name of the player newColor the colour used to fill the player's boxes isPlayerHuman is the player human (or AI)
Definition at line 33 of file ksquaresplayer.h.
| KSquaresPlayer::KSquaresPlayer | ( | ) | [inline] |
Member Function Documentation
| QColor KSquaresPlayer::colour | ( | ) | const [inline] |
| void KSquaresPlayer::incScore | ( | ) | [inline] |
| bool KSquaresPlayer::isHuman | ( | ) | const [inline] |
| QString KSquaresPlayer::name | ( | ) | const [inline] |
Sets the players name.
- Returns:
- The displayable name of the player
Definition at line 50 of file ksquaresplayer.h.
| bool KSquaresPlayer::operator< | ( | const KSquaresPlayer & | player | ) | const [inline] |
Used in sort algorithm.
Compares the player's score (not their height or age or anything :D)
- Parameters:
-
player the player to compare wth this one
- Returns:
- true if player is bigger than this
Definition at line 85 of file ksquaresplayer.h.
| int KSquaresPlayer::score | ( | ) | const [inline] |
| void KSquaresPlayer::setName | ( | const QString & | newName | ) | [inline] |
Sets the players name.
- Parameters:
-
newName The displayable name of the player
Definition at line 43 of file ksquaresplayer.h.
| void KSquaresPlayer::setScore | ( | int | newScore | ) | [inline] |
Sets the players score.
- Parameters:
-
newScore The players new score
Definition at line 57 of file ksquaresplayer.h.
| QString KSquaresPlayer::sig | ( | ) | const [inline] |
Member Data Documentation
QString KSquaresPlayer::displaySig [protected] |
bool KSquaresPlayer::human [protected] |
QColor KSquaresPlayer::playerColour [protected] |
QString KSquaresPlayer::playerName [protected] |
int KSquaresPlayer::playerScore [protected] |
The documentation for this class was generated from the following file:
KDE 4.1 API Reference