ksquares
#include <ksquaresplayer.h>
Public Member Functions | |
| KSquaresPlayer (const QString &newName, const QColor &newColor, bool isPlayerHuman=true) | |
| KSquaresPlayer () | |
| QColor | colour () const | 
| void | incScore () | 
| bool | isHuman () const | 
| 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 | 
Detailed Description
Player class for KSquares.
Class containing All the information about a player.
Definition at line 23 of file ksquaresplayer.h.
Constructor & Destructor Documentation
      
  | 
  inlineexplicit | 
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.
      
  | 
  inline | 
Create a null player.
Definition at line 36 of file ksquaresplayer.h.
Member Function Documentation
      
  | 
  inline | 
- Returns
 - the player's chosen display colour
 
Definition at line 73 of file ksquaresplayer.h.
      
  | 
  inline | 
Increase the players score by 1.
Definition at line 63 of file ksquaresplayer.h.
      
  | 
  inline | 
- Returns
 - Is the player human
 
Definition at line 68 of file ksquaresplayer.h.
      
  | 
  inline | 
Sets the players name.
- Returns
 - The displayable name of the player
 
Definition at line 50 of file ksquaresplayer.h.
      
  | 
  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.
      
  | 
  inline | 
- Returns
 - The players current score
 
Definition at line 61 of file ksquaresplayer.h.
      
  | 
  inline | 
Sets the players name.
- Parameters
 - 
  
newName The displayable name of the player  
Definition at line 43 of file ksquaresplayer.h.
      
  | 
  inline | 
Sets the players score.
- Parameters
 - 
  
newScore The players new score  
Definition at line 57 of file ksquaresplayer.h.
      
  | 
  inline | 
- Returns
 - the player's signature (1 or 2 letters)
 
Definition at line 78 of file ksquaresplayer.h.
Member Data Documentation
      
  | 
  protected | 
Letter (or two) to display on the board.
Definition at line 97 of file ksquaresplayer.h.
      
  | 
  protected | 
Is the player a human.
Definition at line 89 of file ksquaresplayer.h.
      
  | 
  protected | 
Player's display colour.
Definition at line 95 of file ksquaresplayer.h.
      
  | 
  protected | 
The player's displayable name.
Definition at line 93 of file ksquaresplayer.h.
      
  | 
  protected | 
Player's current score.
Definition at line 91 of file ksquaresplayer.h.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.
    KDE API Reference