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

replay.h File Reference

Interface for recording and playing replays. More...

#include "events.h"
#include "ascstring.h"
#include "gamemap.h"
#include "basestreaminterface.h"

Include dependency graph for replay.h:

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

Go to the source code of this file.

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
}

Functions

void logtoreplayinfo (trpl_actions action,...)
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.
void runSpecificReplay (int player, int viewingplayer, bool performEndTurnOperations=true)
 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 hookReplayToSystem ()
 initialized the replay system at program startup

Variables

trunreplay runreplay
int startreplaylate
 a hack to enable the replay in a game that was started without replays


Detailed Description

Interface for recording and playing replays.

Definition in file replay.h.


Enumeration Type Documentation

enum trpl_actions
 

Enumeration values:
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 

Definition at line 31 of file replay.h.


Function Documentation

void checkforreplay void   ) 
 

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

Definition at line 555 of file replay.cpp.

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

Referenced by hookGuiToMap().

void hookReplayToSystem  ) 
 

initialized the replay system at program startup

Definition at line 2709 of file replay.cpp.

References DiplomaticStateVector::anyStateChanged, and logAllianceChanges().

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 601 of file replay.cpp.

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

Referenced by deployMapPlayingHooks().

void logtoreplayinfo trpl_actions  action,
  ...
 

Definition at line 648 of file replay.cpp.

References actmap, Resources::energy, Resources::fuel, GameMap::getUnit(), getUnitResourceCargo(), Resources::material, GameMap::replayinfo, rpl_alliancechange2, rpl_attack, rpl_bldrefuel, rpl_buildobj, rpl_buildobj2, rpl_buildProdLine, rpl_buildtnk, rpl_buildtnk2, rpl_buildtnk3, rpl_buildtnk4, rpl_cancelResearch, rpl_changeheight, rpl_changeheight2, rpl_convert, rpl_convert2, rpl_cutFromGame, rpl_jump, rpl_move, rpl_move2, rpl_move3, rpl_move4, rpl_move5, rpl_moveUnitUp, rpl_moveUnitUpDown, rpl_netcontrol, rpl_produceAmmo, rpl_produceunit, rpl_productionResourceUsage, rpl_putbuilding, rpl_putbuilding2, rpl_putmine, rpl_putmine2, rpl_reactionfire, rpl_reactionFireOff, rpl_reactionFireOn, rpl_recycleUnit, rpl_refuel, rpl_refuel2, rpl_refuel3, rpl_remobj, rpl_remobj2, rpl_removebuilding, rpl_removebuilding2, rpl_removebuilding3, rpl_removemine, rpl_removeProdLine, rpl_removeunit, rpl_repairBuilding, rpl_repairUnit, rpl_repairUnit2, rpl_repairUnit3, rpl_selfdestruct, rpl_setGeneratorStatus, rpl_setResearch, rpl_setResourceProcessingAmount, rpl_techResearched, rpl_trainunit, rpl_transferTribute, tnstream::writeChar(), and tnstream::writeInt().

Referenced by ContainerControls::buildProductionLine(), SelfDestruct::destruct(), destructbuildinglevel2(), ContainerControls::destructUnit(), execuseraction(), CargoGuiFunctions::RepairUnit::execute(), CargoGuiFunctions::TransferUnitControl::execute(), GuiFunctions::PowerOn::execute(), GuiFunctions::PowerOff::execute(), GuiFunctions::EnableReactionfire::execute(), GuiFunctions::DisableReactionfire::execute(), GuiFunctions::ObjectBuildingGui::execute(), GuiFunctions::VehicleBuildingGui::execute(), GuiFunctions::BuildingConstruction::execute(), BaseVehicleMovement::execute(), VehicleAttack::execute(), VehicleService::execute(), NewVehicleService::executeContainer(), ContainerControls::fillAmmo(), ContainerControls::fillResource(), JumpDrive::jump(), logAllianceChanges(), ContainerControls::moveUnitDown(), ContainerControls::moveUnitUp(), InternalAmmoTransferHandler::performTransfer(), ContainerControls::produceAmmo(), ContainerControls::produceUnit(), putMine(), ContainerControls::removeProductionLine(), BuildingControlWindow::repair(), researchCheck(), tgiveunitawaydlg::run(), ContainerControls::trainUnit(), and tributeTransfer().

void runSpecificReplay int  player,
int  viewingplayer,
bool  performEndTurnOperations = true
 

runs the replay for the given player

Definition at line 521 of file replay.cpp.

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

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 544 of file replay.cpp.

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

Referenced by hookGuiToMap().


Variable Documentation

trunreplay runreplay
 

Definition at line 56 of file replay.cpp.

Referenced by treactionfirereplay::init().

int startreplaylate
 

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

Definition at line 58 of file replay.cpp.

Referenced by initReplayLogging().


Generated on Tue Jun 24 02:06:33 2008 for Advanced Strategic Command by  doxygen 1.4.2