Advanced Strategic Command
|
#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 "researchexecution.h"
#include "gameeventsystem.h"
Go to the source code of this file.
Classes | |
class | ReplayClearer |
Functions | |
bool | authenticateUser (GameMap *actmap, bool allowCancel=true, bool lockView=true, bool throwOnFailure=false) |
void | runai (GameMap *actmap, int playerView, MapDisplayInterface *display) |
int | findNextPlayer (GameMap *actmap, AbstractPlayerProcessing *playerProcessor) |
void | iterateToNextPlayer (GameMap *actmap, bool saveNetwork, int lastPlayer, int lastTurn, MapDisplayInterface *display) |
void | next_turn (GameMap *gamemap, const NextTurnStrategy &nextTurnStrategy, MapDisplayInterface *display, int playerView) |
void | skipTurn (GameMap *gamemap) |
skips the next player. This is for administrative use, for example if a player does not react More... | |
void | checkUsedASCVersions (Player ¤tPlayer) |
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 More... | |
GameMap * | continueNetworkGame (bool mostRecent) |
continues a PBeM game; the current map is deleted More... | |
GameMap * | continueNetworkGame (const ASCString &filename) |
void | checkforvictory (GameMap *gamemap, bool hasTurnControl) |
checks if the current player has terminated another player or even won More... | |
bool authenticateUser | ( | GameMap * | actmap, |
bool | allowCancel = true , |
||
bool | lockView = true , |
||
bool | throwOnFailure = false |
||
) |
Definition at line 47 of file turncontrol.cpp.
References actmap, GameMap::actplayer, OverviewMapHolder::clear(), Password::empty(), enterpassword(), Player::exist(), Player::existanceAtBeginOfTurn, CGameOptions::getDefaultPassword(), Player::getName(), infoMessage(), CGameOptions::Instance(), Player::isHuman(), Player::off, GameMap::overviewMapHolder, Player::passwordcrc, GameMap::player, GameMap::setPlayerView(), Player::stat, GameMap::time, GameTime::turn(), and viewtextquery().
Referenced by NextTurnStrategy_AskUser::authenticate(), and continueNetworkGame().
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, ASCString::format(), 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 | ( | bool | mostRecent | ) |
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.
Referenced by continueAndStartMultiplayerGame(), continueNetworkGame(), and loadStartupMap().
Definition at line 359 of file turncontrol.cpp.
References authenticateUser(), computeview(), FileTransfer::loadPBEMFile(), and mapLoadingExceptionChecker().
int findNextPlayer | ( | GameMap * | actmap, |
AbstractPlayerProcessing * | playerProcessor | ||
) |
Definition at line 111 of file turncontrol.cpp.
References GameMap::actplayer, Player::exist(), GameMap::getPlayerCount(), Player::off, GameMap::player, AbstractPlayerProcessing::playerSkipped(), and Player::stat.
Referenced by iterateToNextPlayer(), next_turn(), and trunreplay::run().
void iterateToNextPlayer | ( | GameMap * | actmap, |
bool | saveNetwork, | ||
int | lastPlayer, | ||
int | lastTurn, | ||
MapDisplayInterface * | display | ||
) |
Definition at line 156 of file turncontrol.cpp.
References actmap, GameMap::actplayer, GameMap::beginTurn(), Player::computer, displaymessage(), GameMap::endRound(), GameMap::endTurn(), findNextPlayer(), Player::human, GameMap::network, GameMap::player, runai(), GameTransferMechanism::send(), Player::stat, Player::supervisor, and Player::suspended.
Referenced by next_turn(), and skipTurn().
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
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(), iterateToNextPlayer(), GameMap::overviewMapHolder, GameMap::player, GameMap::replayinfo, GameMap::setPlayerView(), GameMap::sigPlayerUserInteractionBegins, GameMap::time, and GameTime::turn().
Referenced by checkforvictory(), endTurn(), endTurn_headLess(), GuiFunctions::EndTurn::execute(), LoseMap::execute(), gamethread(), moveUnitTest(), StartMultiplayerGame::start(), startMap(), testAiHeliMovement1(), testAiMovement1(), testAiMovement2(), testAiMovement3(), testAiMovement4(), testAiMovement5(), testAiMovement6(), testAiMovement7(), testAiService1(), testAiService2(), testAutoRepair(), testDiplomacy1(), testDiplomacy2(), testDiplomacy3(), testLoseMap(), testMapResizeWithMovement(), testPathFinding(), testresearch1(), testresearch2(), and testSelfDamage().
void runai | ( | GameMap * | actmap, |
int | playerView, | ||
MapDisplayInterface * | display | ||
) |
Definition at line 96 of file turncontrol.cpp.
References GameMap::actplayer, Player::ai, computeview(), GameMap::player, BaseAI::run(), GameMap::setPlayerView(), 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 292 of file turncontrol.cpp.
References GameMap::actplayer, GameMap::beginTurn(), GameMap::endTurn(), and iterateToNextPlayer().
Referenced by networksupervisor().