replay.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           replay.h  -  description
00003                              -------------------
00004     begin                : Sun Jan 21 2001
00005     copyright            : (C) 2001 by Martin Bickel
00006     email                : bickel@asc-hq.org
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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

Generated on Mon May 21 01:26:36 2012 for Advanced Strategic Command by  doxygen 1.5.1