replay.cpp File Reference

Everything for recording and playing replays. More...

#include <stdarg.h>
#include "replay.h"
#include "typen.h"
#include "buildingtype.h"
#include "vehicletype.h"
#include "spfst.h"
#include "controls.h"
#include "dialog.h"
#include "gameoptions.h"
#include "viewcalculation.h"
#include "itemrepository.h"
#include "containercontrols.h"
#include "resourcenet.h"
#include "guiiconhandler.h"
#include "guifunctions.h"
#include "cannedmessages.h"
#include "spfst-legacy.h"
#include "replaymapdisplay.h"
#include "asc-mainscreen.h"
#include "loaders.h"
#include "turncontrol.h"
#include "widgets/textrenderer.h"
#include "actions/jumpdrivecommand.h"
#include "reactionfire.h"
#include "gameeventsystem.h"
#include "sdl/graphicsqueue.h"
#include "video/videorecorder.h"
#include "iconrepository.h"
#include "dialogs/replayrecorder.h"
#include "sg.h"
#include "actions/action.h"
#include "actions/cargomovecommand.h"
#include "actions/constructbuildingcommand.h"
#include "actions/destructbuildingcommand.h"
#include "actions/destructunitcommand.h"
#include "actions/recycleunitcommand.h"
#include "actions/trainunitcommand.h"
#include "actions/moveunitcommand.h"
#include "actions/consumeammo.h"
#include "actions/consumeresource.h"
#include "actions/buildproductionlinecommand.h"
#include "actions/removeproductionlinecommand.h"
#include "actions/cancelresearchcommand.h"
#include "researchexecution.h"

Include dependency graph for replay.cpp:

Go to the source code of this file.

Namespaces

namespace  ReplayGuiFunctions

Classes

class  ReplayRecorderWatcherGlobal
class  ReplayRecorder
class  ReplayRecorderWatcherLocal
class  ReplayGuiFunctions::ReplayPlay
class  ReplayGuiFunctions::ReplayPause
class  ReplayGuiFunctions::ReplayFaster
class  ReplayGuiFunctions::ReplaySlower
class  ReplayGuiFunctions::ReplayRewind
class  ReplayGuiFunctions::ReplayExit
class  ReplayGuiFunctions::ReplayRecord
class  ReplayGuiFunctions::ReplayRecordExit
class  ReplayGuiIconHandleHandler
class  LogActionIntoReplayInfo

Enumerations

enum  trpl_actions {
  rpl_attack, rpl_move, rpl_changeheight, rpl_convert,
  rpl_remobj, rpl_buildobj, rpl_putbuilding, rpl_removebuilding,
  rpl_putmine, rpl_removemine, rpl_produceunit, rpl_removeunit,
  rpl_trainunit, rpl_reactionfire, rpl_finished, rpl_shareviewchange,
  rpl_alliancechange, rpl_move2, rpl_buildtnk, rpl_refuel,
  rpl_bldrefuel, rpl_move3, rpl_changeheight2, rpl_buildtnk2,
  rpl_moveUnitUpDown, rpl_move4, rpl_productionResourceUsage, rpl_buildtnk3,
  rpl_refuel2, rpl_buildobj2, rpl_remobj2, rpl_repairUnit,
  rpl_repairUnit2, rpl_refuel3, rpl_produceAmmo, rpl_buildtnk4,
  rpl_buildProdLine, rpl_removeProdLine, rpl_setResearch, rpl_techResearched,
  rpl_putbuilding2, rpl_setGeneratorStatus, rpl_cutFromGame, rpl_removebuilding2,
  rpl_setResourceProcessingAmount, rpl_removebuilding3, rpl_netcontrol, rpl_move5,
  rpl_alliancechange2, rpl_moveUnitUp, rpl_jump, rpl_repairBuilding,
  rpl_recycleUnit, rpl_convert2, rpl_putmine2, rpl_repairUnit3,
  rpl_transferTribute, rpl_reactionFireOn, rpl_reactionFireOff, rpl_selfdestruct,
  rpl_cancelResearch, rpl_runCommandAction
}

Functions

void registerReplayGuiFunctions (GuiIconHandler &handler)
void runSpecificReplay (int player, int viewingplayer, bool performEndTurnOperations)
 runs the replay for the given player
void viewOwnReplay (Player &player)
 runs the replay of the current player. This is used primarily for debugging the replay system
void checkforreplay (void)
 checks if there is replay information and -if there is any- runs the replay
void initReplayLogging (Player &player)
 Initialized the replay logging at the beginning of a players or the ai's turn.
Resources getUnitResourceCargo (Vehicle *veh)
static void logActionToReplay (GameMap *map, Command &command)
void hookReplayToSystem ()
 initialized the replay system at program startup

Variables

trunreplay runreplay
int startreplaylate = 0
 a hack to enable the replay in a game that was started without replays
ReplayRecorderWatcherGlobal replayRecorderWatcherGlobal
ReplayRecorderreplayRecorder = NULL


Detailed Description

Everything for recording and playing replays.

Replays being the moves of other players or the AI, which can be viewed later (especially useful in email games)

Definition in file replay.cpp.


Enumeration Type Documentation

enum trpl_actions

Enumerator:
rpl_attack 
rpl_move 
rpl_changeheight 
rpl_convert 
rpl_remobj 
rpl_buildobj 
rpl_putbuilding 
rpl_removebuilding 
rpl_putmine 
rpl_removemine 
rpl_produceunit 
rpl_removeunit 
rpl_trainunit 
rpl_reactionfire 
rpl_finished 
rpl_shareviewchange 
rpl_alliancechange 
rpl_move2 
rpl_buildtnk 
rpl_refuel 
rpl_bldrefuel 
rpl_move3 
rpl_changeheight2 
rpl_buildtnk2 
rpl_moveUnitUpDown 
rpl_move4 
rpl_productionResourceUsage 
rpl_buildtnk3 
rpl_refuel2 
rpl_buildobj2 
rpl_remobj2 
rpl_repairUnit 
rpl_repairUnit2 
rpl_refuel3 
rpl_produceAmmo 
rpl_buildtnk4 
rpl_buildProdLine 
rpl_removeProdLine 
rpl_setResearch 
rpl_techResearched 
rpl_putbuilding2 
rpl_setGeneratorStatus 
rpl_cutFromGame 
rpl_removebuilding2 
rpl_setResourceProcessingAmount 
rpl_removebuilding3 
rpl_netcontrol 
rpl_move5 
rpl_alliancechange2 
rpl_moveUnitUp 
rpl_jump 
rpl_repairBuilding 
rpl_recycleUnit 
rpl_convert2 
rpl_putmine2 
rpl_repairUnit3 
rpl_transferTribute 
rpl_reactionFireOn 
rpl_reactionFireOff 
rpl_selfdestruct 
rpl_cancelResearch 
rpl_runCommandAction 

Definition at line 75 of file replay.cpp.


Function Documentation

void checkforreplay ( void   ) 

checks if there is replay information and -if there is any- runs the replay

Definition at line 641 of file replay.cpp.

References actmap, GameMap::actplayer, choice_dlg(), Player::human, mainScreenWidget, MainScreenWidget::LockOptions::Menu, GameMap::player, GameMap::replayinfo, runSpecificReplay(), Player::stat, and Player::supervisor.

Referenced by hookGuiToMap().

Resources getUnitResourceCargo ( Vehicle veh  ) 

Definition at line 725 of file replay.cpp.

References ContainerBase::getCargo(), and Vehicle::getTank().

Referenced by trunreplay::execnextreplaymove().

void hookReplayToSystem (  ) 

initialized the replay system at program startup

Definition at line 2289 of file replay.cpp.

References ActionContainer::commitCommand, and logActionToReplay().

Referenced by loaddata().

void initReplayLogging ( Player player  ) 

Initialized the replay logging at the beginning of a players or the ai's turn.

Definition at line 687 of file replay.cpp.

References fatalError(), Player::getParentMap(), Player::getPosition(), Player::off, GameMap::replayinfo, savereplay(), startreplaylate, Player::stat, and tnstream::writing.

Referenced by deployMapPlayingHooks().

static void logActionToReplay ( GameMap map,
Command command 
) [static]

Definition at line 768 of file replay.cpp.

References LogActionIntoReplayInfo::saveCommand().

Referenced by hookReplayToSystem().

void registerReplayGuiFunctions ( GuiIconHandler handler  ) 

Definition at line 552 of file replay.cpp.

References GuiIconHandler::registerUserFunction().

Referenced by ReplayGuiIconHandleHandler::ReplayGuiIconHandleHandler().

void runSpecificReplay ( int  player,
int  viewingplayer,
bool  performEndTurnOperations 
)

runs the replay for the given player

Definition at line 600 of file replay.cpp.

References actmap, errorMessage(), GameMap::replayinfo, trunreplay::run(), and runreplay.

Referenced by checkforreplay(), and viewOwnReplay().

void viewOwnReplay ( Player player  ) 

runs the replay of the current player. This is used primarily for debugging the replay system

Definition at line 630 of file replay.cpp.

References choice_dlg(), Player::getParentMap(), Player::getPosition(), Player::human, CGameOptions::Instance(), GameMap::replayinfo, runSpecificReplay(), Player::stat, and Player::supervisor.

Referenced by hookGuiToMap().


Variable Documentation

ReplayRecorder* replayRecorder = NULL

Definition at line 239 of file replay.cpp.

Referenced by ReplayGuiFunctions::ReplayRecordExit::available(), trunreplay::execnextreplaymove(), ReplayGuiFunctions::ReplayRecordExit::execute(), ReplayGuiFunctions::ReplayRecord::execute(), and trunreplay::run().

class ReplayRecorderWatcherGlobal replayRecorderWatcherGlobal

Referenced by ReplayRecorder::ReplayRecorder().

trunreplay runreplay

Definition at line 70 of file replay.cpp.

Referenced by ReplayGuiFunctions::ReplayRecordExit::available(), ReplayGuiFunctions::ReplayRecord::available(), ReplayGuiFunctions::ReplayExit::available(), ReplayGuiFunctions::ReplayRewind::available(), ReplayGuiFunctions::ReplaySlower::available(), ReplayGuiFunctions::ReplayFaster::available(), ReplayGuiFunctions::ReplayPause::available(), ReplayGuiFunctions::ReplayPlay::available(), ReplayGuiFunctions::ReplayRecordExit::execute(), ReplayGuiFunctions::ReplayRecord::execute(), ReplayGuiFunctions::ReplayExit::execute(), ReplayGuiFunctions::ReplayRewind::execute(), ReplayGuiFunctions::ReplayPause::execute(), ReplayGuiFunctions::ReplayPlay::execute(), and runSpecificReplay().

int startreplaylate = 0

a hack to enable the replay in a game that was started without replays

Definition at line 72 of file replay.cpp.

Referenced by initReplayLogging().


Generated on Mon May 21 01:41:48 2012 for Advanced Strategic Command by  doxygen 1.5.1