Duplicate Class Reference

#include <duplicate.h>

Inheritance diagram for Duplicate:

Game

Detailed Description

This class handles the logic specific to a duplicate game.

The trick in this mode is that the players will not necessarily play they word always in the same order, so we need to implement a "synchronization":

AI players play after human ones, because with the current implementation of the interfaces it is too easy for a player to see the rack of other players, and in particular a human player could take advantage of that to have more clues about the best word. TODO: better isolation of the players...

Definition at line 49 of file duplicate.h.

Public Member Functions

virtual GameMode getMode () const
virtual string getModeAsString () const
virtual int start ()
 Game handling.
virtual int setRackRandom (int, bool, set_rack_mode)
virtual int play (const string &iCoord, const string &iWord)
virtual int endTurn ()
int setPlayer (int)
void prevHumanPlayer ()
void nextHumanPlayer ()

Friends

class GameFactory


Member Function Documentation

int Duplicate::endTurn  )  [virtual]
 

Implements Game.

Definition at line 143 of file duplicate.cpp.

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

Referenced by play().

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

Implements Game.

Definition at line 53 of file duplicate.h.

References Game::kDUPLICATE.

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

Implements Game.

Definition at line 54 of file duplicate.h.

void Duplicate::nextHumanPlayer  ) 
 

Definition at line 275 of file duplicate.cpp.

References Game::getNHumanPlayers(), Game::m_currPlayer, Game::m_players, and Game::nextPlayer().

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

Implements Game.

Definition at line 53 of file duplicate.cpp.

References Game::checkPlayedWord(), endTurn(), and Game::m_currPlayer.

Referenced by loop_duplicate().

void Duplicate::prevHumanPlayer  ) 
 

Definition at line 262 of file duplicate.cpp.

References Game::getNHumanPlayers(), Game::m_currPlayer, Game::m_players, and Game::prevPlayer().

int Duplicate::setPlayer int   ) 
 

Definition at line 249 of file duplicate.cpp.

References ASSERT, Game::getNPlayers(), Game::m_currPlayer, and Game::m_players.

Referenced by loop_duplicate().

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

Definition at line 42 of file duplicate.cpp.

References Game::helperSetRackRandom().

int Duplicate::start  )  [virtual]
 

Game handling.

Implements Game.

Definition at line 95 of file duplicate.cpp.

References ASSERT.

Referenced by main_loop().


Friends And Related Function Documentation

friend class GameFactory [friend]
 

Definition at line 51 of file duplicate.h.


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