00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef replayH
00019 #define replayH
00020
00021 #include "events.h"
00022 #include "ascstring.h"
00023 #include "gamemap.h"
00024 #include "basestreaminterface.h"
00025
00031 class ReplayMapDisplay;
00032
00033 class trunreplay {
00034 ASCString lastErrorMessage;
00035 ReplayMapDisplay* replayMapDisplay;
00036 protected:
00037 int movenum;
00038 void execnextreplaymove ( void );
00039 GameMap* orgmap;
00040 MemoryStream* stream;
00041 void wait ( int t = ticker );
00042 void wait ( MapCoordinate pos, int t = ticker );
00043 void wait ( MapCoordinate pos1, MapCoordinate pos2, int t = ticker );
00044 int actplayer;
00045
00046 void error( const char* message, ... );
00047 void error( const MapCoordinate& pos, const char* message, ... );
00048 void error( const ASCString& message );
00049 void error( const MapCoordinate& pos, const ASCString& message );
00050 void error( const ActionResult& res );
00051
00052 char nextaction;
00053
00054 Context createReplayContext();
00055
00056 void readnextaction ( void );
00057 void displayActionCursor ( int x1, int y1, int x2 = -1, int y2 = -1, int secondWait = 0 );
00058 void removeActionCursor( void );
00059
00060 public:
00061 trunreplay();
00062 int status;
00063 void firstinit();
00064 int run ( int player, int viewingplayer, bool performEndTurnOperations );
00065 ~trunreplay();
00066 };
00067
00068 class LockReplayRecording {
00069 GameMap::ReplayInfo& ri;
00070 public:
00071 LockReplayRecording ( GameMap::ReplayInfo& _ri );
00072 ~LockReplayRecording();
00073 };
00074
00075 extern trunreplay runreplay;
00076
00078 extern int startreplaylate;
00079
00081 extern void checkforreplay ( void );
00082
00084 extern void initReplayLogging( Player& player );
00085
00087 extern void runSpecificReplay( int player, int viewingplayer, bool performEndTurnOperations = true );
00088
00090 extern void viewOwnReplay( Player& player );
00091
00093 extern void hookReplayToSystem();
00094
00095 #endif