#include <TurnController.h>
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 TurnController * | instance () |
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 TurnController * | instance_ = 0 |
Private Member Functions | |
| TurnController () | |
| virtual | ~TurnController () |
Definition at line 26 of file TurnController.h.
| TurnController::TurnController | ( | ) | [private] |
Definition at line 42 of file TurnController.cpp.
| TurnController::~TurnController | ( | ) | [private, virtual] |
Definition at line 46 of file TurnController.cpp.
| 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] |
| 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] |
TurnController * TurnController::instance_ = 0 [static, protected] |
std::list<unsigned int> TurnController::playerOrder_ [protected] |
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().
1.5.3