Training Class Reference

#include <training.h>

Inheritance diagram for Training:

Game

Detailed Description

This class handles the logic specific to a training game.

As its name indicates, it is not a game in the literal meaning of the word, in particular because the rack can be set at will. Note: No player should be added to this game, a human player is added automatically (in the start() method)

Definition at line 39 of file training.h.

Public Member Functions

virtual GameMode getMode () const
virtual string getModeAsString () const
virtual int start ()
 Game handling.
virtual int play (const string &iCoord, const string &iWord)
virtual int endTurn ()
void search ()
int playResult (int)
virtual int setRackRandom (int, bool, set_rack_mode)
int setRackManual (bool iCheck, const string &iLetters)
int setRack (set_rack_mode iMode, bool iCheck, const string &iLetters)
virtual void addHumanPlayer ()
virtual void addAIPlayer ()
const ResultsgetResults () const
void testPlay (int)
 Place a temporary word on the board for preview purpose.
void removeTestPlay ()
 Remove the temporary word(s).
string getTestPlayWord () const
 Get the temporary word.

Friends

class GameFactory


Member Function Documentation

void Training::addAIPlayer  )  [virtual]
 

Reimplemented from Game.

Definition at line 179 of file training.cpp.

References ASSERT.

void Training::addHumanPlayer  )  [virtual]
 

Reimplemented from Game.

Definition at line 172 of file training.cpp.

References ASSERT.

int Training::endTurn  )  [virtual]
 

Implements Game.

Definition at line 131 of file training.cpp.

Referenced by play(), and playResult().

virtual GameMode Training::getMode  )  const [inline, virtual]
 

Implements Game.

Definition at line 43 of file training.h.

References Game::kTRAINING.

Referenced by main_loop().

virtual string Training::getModeAsString  )  const [inline, virtual]
 

Implements Game.

Definition at line 44 of file training.h.

const Results& Training::getResults  )  const [inline]
 

Definition at line 70 of file training.h.

Referenced by GameIO::printSearchResults(), and searchResultLine().

std::string Training::getTestPlayWord  )  const
 

Get the temporary word.

Definition at line 200 of file training.cpp.

References Round::getWord().

int Training::play const string &  iCoord,
const string &  iWord
[virtual]
 

Implements Game.

Definition at line 95 of file training.cpp.

References Game::checkPlayedWord(), endTurn(), Round::getPoints(), History::getSize(), Game::helperPlayRound(), Game::m_currPlayer, Game::m_history, and Game::m_players.

Referenced by loop_training().

int Training::playResult int   ) 
 

Definition at line 148 of file training.cpp.

References Player::addPoints(), Results::clear(), endTurn(), Player::endTurn(), Results::get(), History::getSize(), Game::helperPlayRound(), Game::m_currPlayer, Game::m_history, Game::m_players, and Results::size().

Referenced by loop_training().

void Training::removeTestPlay  ) 
 

Remove the temporary word(s).

Definition at line 194 of file training.cpp.

References Game::m_board, and Board::removeTestRound().

void Training::search  ) 
 

Definition at line 138 of file training.cpp.

References debug, History::getSize(), Game::m_board, Game::m_currPlayer, Game::m_dic, Game::m_history, Game::m_players, Results::search(), and Rack::toString().

Referenced by loop_training().

int Training::setRack set_rack_mode  iMode,
bool  iCheck,
const string &  iLetters
 

Definition at line 77 of file training.cpp.

References Game::m_currPlayer, Game::RACK_ALL, Game::RACK_NEW, setRackManual(), and setRackRandom().

int Training::setRackManual bool  iCheck,
const string &  iLetters
 

Definition at line 55 of file training.cpp.

References Results::clear(), and Game::m_currPlayer.

Referenced by loop_training(), and setRack().

int Training::setRackRandom int  ,
bool  ,
set_rack_mode 
[virtual]
 

Definition at line 41 of file training.cpp.

References Results::clear(), and Game::helperSetRackRandom().

Referenced by loop_training(), and setRack().

int Training::start  )  [virtual]
 

Game handling.

Implements Game.

Definition at line 120 of file training.cpp.

References Game::addHumanPlayer(), Game::getNPlayers(), and Game::m_currPlayer.

Referenced by EVT_TEXT_ENTER(), and main_loop().

void Training::testPlay int   ) 
 

Place a temporary word on the board for preview purpose.

Definition at line 186 of file training.cpp.

References ASSERT, Results::get(), Game::m_board, Results::size(), and Board::testRound().


Friends And Related Function Documentation

friend class GameFactory [friend]
 

Definition at line 41 of file training.h.


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