18 #ifndef INCLUDED_REPLAY 19 #define INCLUDED_REPLAY 39 virtual void StartGame(JS::MutableHandleValue attribs) = 0;
44 virtual void Turn(
u32 n,
u32 turnLength, std::vector<SimulationCommand>& commands) = 0;
49 virtual void Hash(
const std::string& hash,
bool quick) = 0;
79 virtual void StartGame(JS::MutableHandleValue attribs);
80 virtual void Turn(
u32 n,
u32 turnLength, std::vector<SimulationCommand>& commands);
81 virtual void Hash(
const std::string& hash,
bool quick);
99 void Load(
const std::string& path);
100 void Replay(
bool serializationtest,
int rejointestturn,
bool ooslog);
106 #endif // INCLUDED_REPLAY #define NONCOPYABLE(className)
Indicates that a class is noncopyable (usually due to const or reference members, or because the clas...
Definition: code_annotation.h:217
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
Definition: code_annotation.h:38
virtual ~IReplayLogger()
Definition: Replay.h:34
virtual OsPath GetDirectory() const
Remember the directory containing the commands.txt file, so that we can save additional files to it...
Definition: Replay.h:66
std::ostream * m_Stream
Definition: Replay.h:86
virtual void Turn(u32 n, u32 turnLength, std::vector< SimulationCommand > &commands)=0
Run the given turn with the given collection of player commands.
Replay log recorder interface.
Definition: Replay.h:30
uint32_t u32
Definition: types.h:39
virtual void StartGame(JS::MutableHandleValue attribs)=0
Started the game with the given game attributes.
Replay log replayer.
Definition: Replay.h:93
Path OsPath
Definition: os_path.h:31
Simulation command, typically received over the network in multiplayer games.
Definition: SimulationCommand.h:27
virtual void Hash(const std::string &hash, bool quick)=0
Optional hash of simulation state (for sync checking).
static Status Load(const OsPath &pathname, void *buf, size_t size, const Parameters &p=Parameters(), const CompletedHook &completedHook=CompletedHook(), const IssueHook &issueHook=IssueHook())
Definition: io.h:337
OsPath m_Directory
Definition: Replay.h:87
virtual void Turn(u32 n, u32 turnLength, std::vector< SimulationCommand > &commands)
Run the given turn with the given collection of player commands.
Definition: Replay.h:64
IReplayLogger()
Definition: Replay.h:33
std::istream * m_Stream
Definition: Replay.h:103
ScriptInterface & m_ScriptInterface
Definition: Replay.h:85
virtual void Hash(const std::string &hash, bool quick)
Optional hash of simulation state (for sync checking).
Definition: Replay.h:65
virtual OsPath GetDirectory() const =0
Remember the directory containing the commands.txt file, so that we can save additional files to it...
Abstraction around a SpiderMonkey JSContext.
Definition: ScriptInterface.h:71
Implementation of IReplayLogger that saves data to a file in the logs directory.
Definition: Replay.h:72
Implementation of IReplayLogger that simply throws away all data.
Definition: Replay.h:60
virtual void StartGame(JS::MutableHandleValue attribs)
Started the game with the given game attributes.
Definition: Replay.h:63