TurnController Class Reference

#include <TurnController.h>

List of all members.

Public Member Functions

void newGame ()
void nextRound ()
void nextShot ()
void nextTurn ()
bool playerThisTurn (unsigned int playerId)
std::list< unsigned
int > & 
getPlayersThisShot ()
std::list< unsigned
int > & 
getPlayersThisTurn ()
std::list< unsigned
int > & 
getPlayersLeftToMove ()

Static Public Member Functions

static TurnControllerinstance ()

Protected Attributes

std::list< unsigned int > playerOrder_
std::list< unsigned int > playersLeftToMove_
std::list< unsigned int > playersThisShot_
std::list< unsigned int > playersThisTurn_

Static Protected Attributes

static TurnControllerinstance_ = 0

Private Member Functions

 TurnController ()
virtual ~TurnController ()


Detailed Description

Definition at line 26 of file TurnController.h.


Constructor & Destructor Documentation

TurnController::TurnController (  )  [private]

Definition at line 42 of file TurnController.cpp.

TurnController::~TurnController (  )  [private, virtual]

Definition at line 46 of file TurnController.cpp.


Member Function Documentation

TurnController * TurnController::instance (  )  [static]

Definition at line 33 of file TurnController.cpp.

References instance_.

Referenced by ServerPlayingState::acceptStateChange(), ServerNextTurnState::enterState(), ServerNextShotState::enterState(), ServerNextRoundState::enterState(), ServerNewGameState::enterState(), ServerShotHolder::haveAllTurnShots(), ServerPlayedMoveHandler::processMessage(), ServerGiftMoneyHandler::processMessage(), ServerBuyAccessoryHandler::processMessage(), and ServerShotHolder::sendWaitingMessage().

void TurnController::newGame (  ) 

Definition at line 50 of file TurnController.cpp.

References ScorchedContext::getOptionsGame(), TankSort::getSortedTanksIds(), ScorchedServer::instance(), int(), playerOrder_, RAND, OptionsGame::TurnSequentialLooserFirst, and OptionsGame::TurnSequentialRandom.

Referenced by ServerNewGameState::enterState().

void TurnController::nextRound (  ) 

Definition at line 103 of file TurnController.cpp.

References playerOrder_, and playersLeftToMove_.

Referenced by ServerNextRoundState::enterState().

void TurnController::nextShot (  ) 

Definition at line 110 of file TurnController.cpp.

References S3D::dialogMessage(), S3D::formatStringBuffer(), ScorchedContext::getOptionsGame(), Target::getPlayerId(), TankState::getState(), Tank::getState(), TankContainer::getTankById(), ScorchedContext::getTankContainer(), ScorchedServer::instance(), playersLeftToMove_, playersThisShot_, TankState::sNormal, OptionsGame::TurnSequentialLooserFirst, OptionsGame::TurnSequentialRandom, and OptionsGame::TurnSimultaneous.

Referenced by ServerNextShotState::enterState().

void TurnController::nextTurn (  ) 

Definition at line 174 of file TurnController.cpp.

References Tank::getDestinationId(), TankState::getState(), Tank::getState(), TankContainer::getTankById(), ScorchedContext::getTankContainer(), ScorchedServer::instance(), playersThisShot_, playersThisTurn_, and TankState::sNormal.

Referenced by ServerNextTurnState::enterState().

bool TurnController::playerThisTurn ( unsigned int  playerId  ) 

Definition at line 214 of file TurnController.cpp.

References playersThisTurn_.

Referenced by ServerPlayedMoveHandler::processMessage().

std::list<unsigned int>& TurnController::getPlayersThisShot (  )  [inline]

Definition at line 37 of file TurnController.h.

References playersThisShot_.

std::list<unsigned int>& TurnController::getPlayersThisTurn (  )  [inline]

Definition at line 38 of file TurnController.h.

References playersThisTurn_.

Referenced by ServerPlayingState::acceptStateChange(), ServerNextTurnState::enterState(), ServerShotHolder::haveAllTurnShots(), and ServerShotHolder::sendWaitingMessage().

std::list<unsigned int>& TurnController::getPlayersLeftToMove (  )  [inline]

Definition at line 39 of file TurnController.h.

References playersLeftToMove_.


Member Data Documentation

TurnController * TurnController::instance_ = 0 [static, protected]

Definition at line 42 of file TurnController.h.

Referenced by instance().

std::list<unsigned int> TurnController::playerOrder_ [protected]

Definition at line 44 of file TurnController.h.

Referenced by newGame(), and nextRound().

std::list<unsigned int> TurnController::playersLeftToMove_ [protected]

Definition at line 45 of file TurnController.h.

Referenced by getPlayersLeftToMove(), nextRound(), and nextShot().

std::list<unsigned int> TurnController::playersThisShot_ [protected]

Definition at line 46 of file TurnController.h.

Referenced by getPlayersThisShot(), nextShot(), and nextTurn().

std::list<unsigned int> TurnController::playersThisTurn_ [protected]

Definition at line 47 of file TurnController.h.

Referenced by getPlayersThisTurn(), nextTurn(), and playerThisTurn().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:08 2009 for Scorched3D by  doxygen 1.5.3