• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

ksquares

KSquaresPlayer Class Reference

#include <ksquaresplayer.h>

List of all members.


Detailed Description

Player class for KSquares.

Class containing All the information about a player.

Author:
Matt Williams <matt@milliams.com>

Definition at line 23 of file ksquaresplayer.h.


Public Member Functions

 KSquaresPlayer (const QString &newName, const QColor &newColor, bool isPlayerHuman=true)
 KSquaresPlayer ()
void setName (const QString &newName)
QString name () const
void setScore (int newScore)
int score () const
void incScore ()
bool isHuman () const
QColor colour () const
QString sig () const
bool operator< (const KSquaresPlayer &player) const

Protected Attributes

bool human
int playerScore
QString playerName
QColor playerColour
QString displaySig

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]

Create a null player.

Definition at line 36 of file ksquaresplayer.h.


Member Function Documentation

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.

QString KSquaresPlayer::name (  )  const [inline]

Sets the players name.

Returns:
The displayable name of the player

Definition at line 50 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.

int KSquaresPlayer::score (  )  const [inline]

Returns:
The players current score

Definition at line 61 of file ksquaresplayer.h.

void KSquaresPlayer::incScore (  )  [inline]

Increase the players score by 1.

Definition at line 63 of file ksquaresplayer.h.

bool KSquaresPlayer::isHuman (  )  const [inline]

Returns:
Is the player human

Definition at line 68 of file ksquaresplayer.h.

QColor KSquaresPlayer::colour (  )  const [inline]

Returns:
the player's chosen display colour

Definition at line 73 of file ksquaresplayer.h.

QString KSquaresPlayer::sig (  )  const [inline]

Returns:
the player's signature (1 or 2 letters)

Definition at line 78 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.


Member Data Documentation

bool KSquaresPlayer::human [protected]

Is the player a human.

Definition at line 89 of file ksquaresplayer.h.

int KSquaresPlayer::playerScore [protected]

Player's current score.

Definition at line 91 of file ksquaresplayer.h.

QString KSquaresPlayer::playerName [protected]

The player's displayable name.

Definition at line 93 of file ksquaresplayer.h.

QColor KSquaresPlayer::playerColour [protected]

Player's display colour.

Definition at line 95 of file ksquaresplayer.h.

QString KSquaresPlayer::displaySig [protected]

Letter (or two) to display on the board.

Definition at line 97 of file ksquaresplayer.h.


The documentation for this class was generated from the following file:
  • ksquaresplayer.h

ksquares

Skip menu "ksquares"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal