Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

turncontrol.cpp File Reference

#include "turncontrol.h"
#include "gamemap.h"
#include "mapdisplay.h"
#include "gameoptions.h"
#include "dialogs/pwd_dlg.h"
#include "controls.h"
#include "spfst.h"
#include "dlg_box.h"
#include "ai/ai.h"
#include "dialog.h"
#include "strtmesg.h"
#include "loaders.h"
#include "cannedmessages.h"
#include "viewcalculation.h"
#include "network/simple_file_transfer.h"
#include "dialogs/fileselector.h"

Include dependency graph for turncontrol.cpp:

Go to the source code of this file.

Functions

bool authenticateUser (GameMap *actmap, int forcepasswordchecking=0, bool allowCancel=true, bool lockView=true, bool throwOnFailure=false)
void runai (GameMap *actmap, int playerView)
int findNextPlayer (const GameMap *actmap)
void clearReplays (GameMap *actmap)
 deactivates the replays of non-active or deleted players
void iterateToNextPlayer (GameMap *actmap, bool saveNetwork, int lastPlayer, int lastTurn)
void next_turn (int playerView)
void skipTurn (GameMap *gamemap)
 skips the next player. This is for administrative use, for example if a player does not react
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
bool continuenetworkgame (bool mostRecent)
 continues a PBeM game; the current map is deleted
bool continuenetworkgame (const ASCString &filename)
void checkforvictory (bool hasTurnControl)
 checks if the current player has terminated another player or even won


Function Documentation

bool authenticateUser GameMap actmap,
int  forcepasswordchecking = 0,
bool  allowCancel = true,
bool  lockView = true,
bool  throwOnFailure = false
 

Definition at line 45 of file turncontrol.cpp.

References GameMap::actplayer, OverviewMapHolder::clear(), Password::empty(), enterpassword(), Player::exist(), Player::existanceAtBeginOfTurn, infoMessage(), CGameOptions::Instance(), Player::isHuman(), moveparams, tmoveparams::movestatus, Player::off, GameMap::overviewMapHolder, Player::passwordcrc, GameMap::player, GameMap::setPlayerView(), Player::stat, GameMap::time, GameTime::turn(), and viewtextquery().

Referenced by continuenetworkgame(), and next_turn().

void checkforvictory bool  hasTurnControl  ) 
 

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

Definition at line 351 of file turncontrol.cpp.

References actmap, GameMap::actplayer, GameMap::Campaign::avail, GameMap::campaign, choice_dlg(), GameMap::continueplaying, displaymessage(), Player::exist(), Player::existanceAtBeginOfTurn, getmessage(), Player::getName(), GameMap::getPlayer(), GameMap::getPlayerView(), Player::human, 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 274 of file turncontrol.cpp.

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

Referenced by hookGuiToMap().

void clearReplays GameMap actmap  ) 
 

deactivates the replays of non-active or deleted players

Definition at line 142 of file turncontrol.cpp.

Referenced by iterateToNextPlayer().

bool continuenetworkgame const ASCString filename  ) 
 

Definition at line 330 of file turncontrol.cpp.

References actmap, GameMap::actplayer, authenticateUser(), GameMap::beginTurn(), computeview(), FileTransfer::loadPBEMFile(), mapLoadingExceptionChecker(), and GameMap::setPlayerView().

bool continuenetworkgame bool  mostRecent  ) 
 

continues a PBeM game; the current map is deleted

Definition at line 295 of file turncontrol.cpp.

Referenced by continueAndStartMultiplayerGame(), continuenetworkgame(), and loadStartupMap().

int findNextPlayer const GameMap actmap  ) 
 

Definition at line 117 of file turncontrol.cpp.

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

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

void iterateToNextPlayer GameMap actmap,
bool  saveNetwork,
int  lastPlayer,
int  lastTurn
 

Definition at line 157 of file turncontrol.cpp.

References clearReplays(), Player::computer, displaymessage(), findNextPlayer(), Player::human, runai(), Player::supervisor, and Player::suspended.

Referenced by next_turn(), and skipTurn().

void next_turn 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 210 of file turncontrol.cpp.

References actmap, GameMap::actplayer, authenticateUser(), choice_dlg(), GameMap::endTurn(), findNextPlayer(), Player::human, iterateToNextPlayer(), GameMap::player, GameMap::time, GameTime::turn(), and viewtext2().

Referenced by checkforvictory(), GuiFunctions::EndTurn::execute(), gamethread(), and StartMultiplayerGame::start().

void runai GameMap actmap,
int  playerView
 

Definition at line 102 of file turncontrol.cpp.

References computeview(), and updateFieldInfo.

Referenced by iterateToNextPlayer().

void skipTurn GameMap gamemap  ) 
 

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

Definition at line 265 of file turncontrol.cpp.

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

Referenced by networksupervisor().


Generated on Tue Jun 24 02:12:32 2008 for Advanced Strategic Command by  doxygen 1.4.2