Player Class Reference

#include <player.h>

Inheritance diagram for Player:

AIPlayer HumanPlayer AIPercent

Detailed Description

This class is the parent class for all the players involved in a game.

It defines the common methods to update the rack, score, etc...

Definition at line 35 of file player.h.

Public Member Functions

 Player (int iId)
virtual ~Player ()
virtual bool isHuman () const =0
const PlayedRackgetCurrentRack () const
const PlayedRackgetLastRack () const
const RoundgetLastRound () const
void setCurrentRack (const PlayedRack &iPld)
const HistorygetHistory () const
void removeLastTurn ()
 Remove last turn.
void addPoints (int iPoints)
int getPoints () const
void endTurn (const Round &iRound, int iTurn)
const string toString () const


Constructor & Destructor Documentation

Player::Player int  iId  ) 
 

Definition at line 33 of file player.cpp.

Player::~Player  )  [virtual]
 

Definition at line 40 of file player.cpp.


Member Function Documentation

void Player::addPoints int  iPoints  )  [inline]
 

Definition at line 65 of file player.h.

Referenced by Game::back(), and Training::playResult().

void Player::endTurn const Round iRound,
int  iTurn
 

Definition at line 69 of file player.cpp.

References History::playRound().

Referenced by Training::playResult().

const PlayedRack & Player::getCurrentRack  )  const
 

Definition at line 45 of file player.cpp.

References History::getCurrentRack().

Referenced by AIPercent::compute(), Game::getPlayerRack(), Game::helperPlayRound(), Game::helperSetRackManual(), Game::helperSetRackRandom(), Game::realBag(), GfxResult::Refresh(), and Plus1Frame::refresh().

const History& Player::getHistory  )  const [inline]
 

Definition at line 56 of file player.h.

const PlayedRack & Player::getLastRack  )  const
 

Definition at line 57 of file player.cpp.

References Turn::getPlayedRack(), and History::getPreviousTurn().

Referenced by Game::helperPlayRound().

const Round & Player::getLastRound  )  const
 

Definition at line 63 of file player.cpp.

References History::getPreviousTurn(), and Turn::getRound().

int Player::getPoints  )  const [inline]
 

Definition at line 66 of file player.h.

Referenced by GameIO::printAllPoints(), and GameIO::printPoints().

virtual bool Player::isHuman  )  const [pure virtual]
 

Implemented in AIPlayer, and HumanPlayer.

Referenced by Game::getNHumanPlayers().

void Player::removeLastTurn  ) 
 

Remove last turn.

Definition at line 74 of file player.cpp.

References History::removeLastTurn().

Referenced by Game::back().

void Player::setCurrentRack const PlayedRack iPld  ) 
 

Definition at line 51 of file player.cpp.

References History::setCurrentRack().

const string Player::toString  )  const
 

Definition at line 79 of file player.cpp.

References History::toString().

Referenced by GameFrame::Refresh().


The documentation for this class was generated from the following files:
Generated on Thu Dec 29 02:01:15 2005 for Eliot by  doxygen 1.4.5