Advanced Strategic Command
replay.h
Go to the documentation of this file.
1 /***************************************************************************
2  replay.h - description
3  -------------------
4  begin : Sun Jan 21 2001
5  copyright : (C) 2001 by Martin Bickel
6  email : bickel@asc-hq.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef replayH
19  #define replayH
20 
21 #include "events.h"
22 #include "ascstring.h"
23 #include "gamemap.h"
24 #include "basestreaminterface.h"
25 
31 class ReplayMapDisplay;
32 
33 class trunreplay {
34  ASCString lastErrorMessage;
35  ReplayMapDisplay* replayMapDisplay;
36  protected:
37  int movenum;
38  void execnextreplaymove ( void );
41  void wait ( int t = ticker );
42  void wait ( MapCoordinate pos, int t = ticker );
43  void wait ( MapCoordinate pos1, MapCoordinate pos2, int t = ticker );
44  int actplayer;
45 
46  void error( const char* message, ... );
47  void error( const MapCoordinate& pos, const char* message, ... );
48  void error( const ASCString& message );
49  void error( const MapCoordinate& pos, const ASCString& message );
50  void error( const ActionResult& res );
51 
53 
55 
56  void readnextaction ( void );
57  void displayActionCursor ( int x1, int y1, int x2 = -1, int y2 = -1, int secondWait = 0 );
58  void removeActionCursor( void );
59 
60  public:
61  trunreplay();
62  int status;
63  void firstinit();
64  int run ( int player, int viewingplayer, bool performEndTurnOperations );
65  ~trunreplay();
66  };
67 
70  public:
73 };
74 
75 extern trunreplay runreplay;
76 
78 extern int startreplaylate;
79 
81 extern void checkforreplay ( void );
82 
84 extern void initReplayLogging( Player& player );
85 
87 extern void runSpecificReplay( int player, int viewingplayer, bool performEndTurnOperations = true );
88 
90 extern void viewOwnReplay( Player& player );
91 
93 extern void hookReplayToSystem();
94 
95 #endif
void execnextreplaymove(void)
Definition: replay.cpp:924
void error(const char *message,...)
Definition: replay.cpp:833
void displayActionCursor(int x1, int y1, int x2=-1, int y2=-1, int secondWait=0)
Definition: replay.cpp:910
Context createReplayContext()
Definition: replay.cpp:775
void readnextaction(void)
Definition: replay.cpp:2127
trunreplay runreplay
Definition: replay.cpp:70
int status
Definition: replay.h:62
void runSpecificReplay(int player, int viewingplayer, bool performEndTurnOperations=true)
runs the replay for the given player
Definition: replay.cpp:600
int run(int player, int viewingplayer, bool performEndTurnOperations)
Definition: replay.cpp:2137
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
trunreplay()
Definition: replay.cpp:795
~trunreplay()
Definition: replay.cpp:802
LockReplayRecording(GameMap::ReplayInfo &_ri)
Definition: replay.cpp:713
void wait(int t=ticker)
Definition: replay.cpp:869
void removeActionCursor(void)
Definition: replay.cpp:917
Coordinate on the twodimensional map.
Definition: typen.h:202
Definition of THE central asc class: GameMap.
Reads data from or writes data to a MemoryStreamStorage This allows a completely volatile storage of ...
Definition: basestrm.h:204
MemoryStream * stream
Definition: replay.h:40
int startreplaylate
a hack to enable the replay in a game that was started without replays
Definition: replay.cpp:72
int nextaction
Definition: replay.h:52
int actplayer
Definition: replay.h:44
void firstinit()
Definition: replay.cpp:2279
void hookReplayToSystem()
initialized the replay system at program startup
Definition: replay.cpp:2285
void initReplayLogging(Player &player)
Initialized the replay logging at the beginning of a players or the ai's turn.
Definition: replay.cpp:687
void checkforreplay(void)
checks if there is replay information and -if there is any- runs the replay
Definition: replay.cpp:641
the different players in ASC. There may be 8 players (0..7) and neutral units (8) ...
Definition: player.h:99
int movenum
Definition: replay.h:37
GameMap * orgmap
Definition: replay.h:39
The standard interface for ASC streams. This is the parent class for all kinds of streams: normal fil...
The map. THE central structure of ASC, which holds everything not globally available together...
Definition: gamemap.h:182
void viewOwnReplay(Player &player)
runs the replay of the current player. This is used primarily for debugging the replay system ...
Definition: replay.cpp:630
volatile int ticker
Definition: events.cpp:234