turncontrol.h File Reference

#include "ascstring.h"

Include dependency graph for turncontrol.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  NextTurnStrategy
 describes the behavier that next_turn() shall do when it finds out that the current player is the last one available More...
class  NextTurnStrategy_AskUser
class  NextTurnStrategy_Abort
class  AbstractPlayerProcessing

Functions

void next_turn (GameMap *gameMap, const NextTurnStrategy &nextTurnStrategy, MapDisplayInterface *display, int playerView=-2)
void checkforvictory (GameMap *gamemap, bool hasTurnControl)
 checks if the current player has terminated another player or even won
GameMapcontinueNetworkGame (bool mostRecent=false)
 continues a PBeM game; the current map is deleted
GameMapcontinueNetworkGame (const ASCString &filename)
void checkUsedASCVersions (Player &currentPlayer)
 this checks if one player has been using a new ASC version than the current player. If this is the case, the current player is notified and asked to upgrade
int findNextPlayer (GameMap *actmap, AbstractPlayerProcessing *playerProcessor=NULL)
void skipTurn (GameMap *gamemap)
 skips the next player. This is for administrative use, for example if a player does not react


Function Documentation

void checkforvictory ( GameMap gamemap,
bool  hasTurnControl 
)

checks if the current player has terminated another player or even won

Definition at line 377 of file turncontrol.cpp.

References GameMap::actplayer, Player::ai, GameMap::Campaign::avail, GameMap::campaign, choice_dlg(), GameMap::continueplaying, displaymessage(), Player::exist(), Player::existanceAtBeginOfTurn, getDefaultMapDisplay(), getmessage(), Player::getName(), GameMap::getPlayer(), GameMap::getPlayerView(), Player::human, BaseAI::isRunning(), next_turn(), GameMap::player, GameMap::replayinfo, and Player::stat.

Referenced by mainloopidle(), and AI::run().

void checkUsedASCVersions ( Player currentPlayer  ) 

this checks if one player has been using a new ASC version than the current player. If this is the case, the current player is notified and asked to upgrade

Definition at line 303 of file turncontrol.cpp.

References GameMap::actplayer, Player::ASCversion, Player::exist(), Player::getName(), getNumericVersion(), Player::getParentMap(), and GameMap::player.

Referenced by hookGuiToMap().

GameMap* continueNetworkGame ( const ASCString filename  ) 

Definition at line 359 of file turncontrol.cpp.

References authenticateUser(), computeview(), FileTransfer::loadPBEMFile(), and mapLoadingExceptionChecker().

GameMap* continueNetworkGame ( bool  mostRecent = false  ) 

continues a PBeM game; the current map is deleted

Definition at line 324 of file turncontrol.cpp.

References continueNetworkGame(), tfindfile::FileInfo::date, tfindfile::getnextname(), tfindfile::FileInfo::name, selectFile(), and tournamentextension.

int findNextPlayer ( GameMap actmap,
AbstractPlayerProcessing playerProcessor = NULL 
)

Definition at line 111 of file turncontrol.cpp.

References actmap, GameMap::actplayer, Player::exist(), GameMap::getPlayerCount(), Player::off, GameMap::player, AbstractPlayerProcessing::playerSkipped(), and Player::stat.

Referenced by iterateToNextPlayer(), next_turn(), and trunreplay::run().

void next_turn ( GameMap gameMap,
const NextTurnStrategy nextTurnStrategy,
MapDisplayInterface display,
int  playerView = -2 
)

Ends the turn of the current player and runs AI until a player is human again

Parameters:
playerView -2 = detect automatically; -1 = don't display anything; 0-7 = this player is watching

Definition at line 232 of file turncontrol.cpp.

References GameMap::actplayer, NextTurnStrategy::authenticate(), GameMap::beginTurn(), checkevents(), checktimedevents(), OverviewMapHolder::clear(), GameMap::continueplaying, NextTurnStrategy::continueWhenLastPlayer(), GameMap::endTurn(), findNextPlayer(), Player::human, iterateToNextPlayer(), GameMap::overviewMapHolder, GameMap::player, GameMap::replayinfo, GameMap::setPlayerView(), GameMap::sigPlayerUserInteractionBegins, Player::stat, GameMap::time, and GameTime::turn().

Referenced by checkforvictory(), endTurn(), endTurn_headLess(), LoseMap::execute(), GuiFunctions::EndTurn::execute(), gamethread(), moveUnitTest(), StartMultiplayerGame::start(), startMap(), testAiHeliMovement1(), testAiMovement1(), testAiMovement2(), testAiMovement3(), testAiMovement4(), testAiMovement5(), testAiMovement6(), testAiMovement7(), testAiService1(), testAiService2(), testDiplomacy1(), testDiplomacy2(), testDiplomacy3(), testLoseMap(), testMapResizeWithMovement(), testresearch1(), and testresearch2().

void skipTurn ( GameMap gamemap  ) 

skips the next player. This is for administrative use, for example if a player does not react

Definition at line 292 of file turncontrol.cpp.

References GameMap::actplayer, GameMap::beginTurn(), GameMap::endTurn(), and iterateToNextPlayer().

Referenced by networksupervisor().


Generated on Mon May 21 01:44:26 2012 for Advanced Strategic Command by  doxygen 1.5.1