KWin4Player Class Reference

A player for the KWin4 game. More...

#include <kwin4player.h>

Collaboration diagram for KWin4Player:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 KWin4Player ()
 Construct a player object,.
int rtti () const
 Runtime identification for the player type (KGame).
void setStatus (Score *s)
 Assign the score object which allows to display player properties in the GUI.
Scorestatus ()
 Retrieve the score object from the player.
void readConfig (KConfigGroup &config)
 Read the player data (status, score) from the configuration file.
void writeConfig (KConfigGroup &config)
 Write the player data (status, score) to the configuration file.
void incWin ()
 Increase the number of wins for this player.
void incRemis ()
 Increase the number of draws for this player.
void incLost ()
 Increase the number of losses for this player.
void incBrk ()
 Increase the number of aborted games for this player.
int win ()
 Retrieve the number of wins.
int lost ()
 Retrieve the number of losses.
int brk ()
 Retrieve the number of aborted games.
int remis ()
 Retriev the number of drawn games.
void resetStats (bool all=true)
 Clear the score of the player.

Protected Slots

void slotPlayerPropertyChanged (KGamePropertyBase *prop, KPlayer *player)
 KGame method which is called when any KGamePropery changes for this player.

Detailed Description

A player for the KWin4 game.

A player holds all important player data, in particular the long time status and score information. Additionally, via the KGame framework it supports various methods of input like mouse, keyboard, AI or even network.

Definition at line 35 of file kwin4player.h.


Constructor & Destructor Documentation

KWin4Player::KWin4Player  ) 
 

Construct a player object,.

Definition at line 28 of file kwin4player.cpp.

References resetStats(), and slotPlayerPropertyChanged().

Here is the call graph for this function:


Member Function Documentation

int KWin4Player::brk  )  [inline]
 

Retrieve the number of aborted games.

Definition at line 97 of file kwin4player.h.

Referenced by KWin4Doc::getStatistic().

void KWin4Player::incBrk  ) 
 

Increase the number of aborted games for this player.

Definition at line 130 of file kwin4player.cpp.

Referenced by KWin4Doc::endGame().

void KWin4Player::incLost  ) 
 

Increase the number of losses for this player.

Definition at line 114 of file kwin4player.cpp.

Referenced by KWin4Doc::endGame().

void KWin4Player::incRemis  ) 
 

Increase the number of draws for this player.

Definition at line 122 of file kwin4player.cpp.

Referenced by KWin4Doc::endGame().

void KWin4Player::incWin  ) 
 

Increase the number of wins for this player.

Definition at line 106 of file kwin4player.cpp.

Referenced by KWin4Doc::endGame().

int KWin4Player::lost  )  [inline]
 

Retrieve the number of losses.

Definition at line 93 of file kwin4player.h.

Referenced by KWin4Doc::getStatistic().

void KWin4Player::readConfig KConfigGroup &  config  ) 
 

Read the player data (status, score) from the configuration file.

Parameters:
config The configuration group

Definition at line 86 of file kwin4player.cpp.

Referenced by KWin4Doc::readConfig().

int KWin4Player::remis  )  [inline]
 

Retriev the number of drawn games.

Definition at line 101 of file kwin4player.h.

Referenced by KWin4Doc::getStatistic().

void KWin4Player::resetStats bool  all = true  ) 
 

Clear the score of the player.

Parameters:
all True: Clear also long time score. False: Clear only session score.

Definition at line 140 of file kwin4player.cpp.

Referenced by KWin4Player(), and KWin4Doc::resetStatistic().

int KWin4Player::rtti  )  const [inline]
 

Runtime identification for the player type (KGame).

Only one player _type_ for kwin4.

Returns:
The player type = 1.

Definition at line 48 of file kwin4player.h.

void KWin4Player::setStatus Score s  )  [inline]
 

Assign the score object which allows to display player properties in the GUI.

Parameters:
s The score object

Definition at line 54 of file kwin4player.h.

void KWin4Player::slotPlayerPropertyChanged KGamePropertyBase *  prop,
KPlayer *  player
[protected, slot]
 

KGame method which is called when any KGamePropery changes for this player.

Parameters:
prop The property
player This player

Definition at line 58 of file kwin4player.cpp.

References Score::setPlayerName().

Referenced by KWin4Player().

Score* KWin4Player::status  )  [inline]
 

Retrieve the score object from the player.

Returns:
The score object.

Definition at line 59 of file kwin4player.h.

Referenced by KWin4Doc::setPlayedBy().

int KWin4Player::win  )  [inline]
 

Retrieve the number of wins.

Definition at line 89 of file kwin4player.h.

Referenced by KWin4Doc::getStatistic().

void KWin4Player::writeConfig KConfigGroup &  config  ) 
 

Write the player data (status, score) to the configuration file.

Parameters:
config The configuration group

Definition at line 96 of file kwin4player.cpp.

Referenced by KWin4Doc::writeConfig().


The documentation for this class was generated from the following files:
Generated on Sun Mar 4 10:56:43 2007 for KWin4 by  doxygen 1.4.6