18 #ifndef INCLUDED_REPLAY 19 #define INCLUDED_REPLAY 44 virtual void StartGame(JS::MutableHandleValue attribs) = 0;
49 virtual void Turn(
u32 n,
u32 turnLength, std::vector<SimulationCommand>& commands) = 0;
54 virtual void Hash(
const std::string& hash,
bool quick) = 0;
90 virtual void StartGame(JS::MutableHandleValue attribs);
91 virtual void Turn(
u32 n,
u32 turnLength, std::vector<SimulationCommand>& commands);
92 virtual void Hash(
const std::string& hash,
bool quick);
112 void Replay(
const bool serializationtest,
const int rejointestturn,
const bool ooslog,
const bool testHashFull,
const bool testHashQuick);
116 void TestHash(
const std::string& hashType,
const std::string& replayHash,
const bool testHashFull,
const bool testHashQuick);
119 #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:227
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
Definition: code_annotation.h:38
const ScriptInterface & m_ScriptInterface
Definition: Replay.h:97
virtual OsPath GetDirectory() const
Remember the directory containing the commands.txt file, so that we can save additional files to it...
Definition: Replay.h:77
virtual ~IReplayLogger()
Definition: Replay.h:39
std::ostream * m_Stream
Definition: Replay.h:98
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:35
virtual void SaveMetadata(const CSimulation2 &simulation)
Saves metadata.json containing part of the simulation state used for the summary screen.
Definition: Replay.h:76
Public API for simulation system.
Definition: Simulation2.h:46
virtual void SaveMetadata(const CSimulation2 &simulation)=0
Saves metadata.json containing part of the simulation state used for the summary screen.
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:105
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:347
OsPath m_Directory
Definition: Replay.h:99
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:74
IReplayLogger()
Definition: Replay.h:38
std::istream * m_Stream
Definition: Replay.h:115
virtual void Hash(const std::string &hash, bool quick)
Optional hash of simulation state (for sync checking).
Definition: Replay.h:75
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 JS::Realm.
Definition: ScriptInterface.h:71
Implementation of IReplayLogger that saves data to a file in the logs directory.
Definition: Replay.h:83
Implementation of IReplayLogger that simply throws away all data.
Definition: Replay.h:70
virtual void StartGame(JS::MutableHandleValue attribs)
Started the game with the given game attributes.
Definition: Replay.h:73