FreeGame Class Reference

#include <freegame.h>

Inheritance diagram for FreeGame:

Game

Detailed Description

This class handles the logic specific to a "free" game.

The algorithm is simple: players play at their turn, and they can either play a word or change letters (changing letters implies passing its turn).

When a player has no more letters (end of the game), the points of the letters left in the racks of his opponents are added to his score, and removed from the score of the latters.

Definition at line 40 of file freegame.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 pass (const string &iToChange, int n)

Friends

class GameFactory


Member Function Documentation

int FreeGame::endTurn  )  [virtual]
 

Implements Game.

Definition at line 130 of file freegame.cpp.

References Game::m_currPlayer, Game::m_players, Game::nextPlayer(), Game::RACK_NEW, and setRackRandom().

Referenced by play().

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

Implements Game.

Definition at line 44 of file freegame.h.

References Game::kFREEGAME.

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

Implements Game.

Definition at line 45 of file freegame.h.

int FreeGame::pass const string &  iToChange,
int  n
 

Definition at line 191 of file freegame.cpp.

References Game::m_finished.

Referenced by loop_freegame().

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

Implements Game.

Definition at line 55 of file freegame.cpp.

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

Referenced by loop_freegame().

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

Definition at line 44 of file freegame.cpp.

References Game::helperSetRackRandom().

Referenced by endTurn(), and start().

int FreeGame::start  )  [virtual]
 

Game handling.

Implements Game.

Definition at line 107 of file freegame.cpp.

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

Referenced by main_loop().


Friends And Related Function Documentation

friend class GameFactory [friend]
 

Definition at line 42 of file freegame.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