Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CReplayLogger Class Reference

Implementation of IReplayLogger that saves data to a file in the logs directory. More...

#include <Replay.h>

Inheritance diagram for CReplayLogger:
Collaboration diagram for CReplayLogger:

Public Member Functions

 CReplayLogger (const ScriptInterface &scriptInterface)
 
 ~CReplayLogger ()
 
virtual void StartGame (JS::MutableHandleValue attribs)
 Started the game with the given game attributes. More...
 
virtual void Turn (u32 n, u32 turnLength, std::vector< SimulationCommand > &commands)
 Run the given turn with the given collection of player commands. More...
 
virtual void Hash (const std::string &hash, bool quick)
 Optional hash of simulation state (for sync checking). More...
 
virtual void SaveMetadata (const CSimulation2 &simulation)
 Saves metadata.json containing part of the simulation state used for the summary screen. More...
 
virtual OsPath GetDirectory () const
 Remember the directory containing the commands.txt file, so that we can save additional files to it. More...
 
- Public Member Functions inherited from IReplayLogger
 IReplayLogger ()
 
virtual ~IReplayLogger ()
 
virtual void StartGame (JS::MutableHandleValue attribs)=0
 Started the game with the given game attributes. More...
 
virtual void Turn (u32 n, u32 turnLength, std::vector< SimulationCommand > &commands)=0
 Run the given turn with the given collection of player commands. More...
 
virtual void Hash (const std::string &hash, bool quick)=0
 Optional hash of simulation state (for sync checking). More...
 
virtual void SaveMetadata (const CSimulation2 &simulation)=0
 Saves metadata.json containing part of the simulation state used for the summary screen. More...
 
virtual OsPath GetDirectory () const =0
 Remember the directory containing the commands.txt file, so that we can save additional files to it. More...
 

Private Member Functions

 NONCOPYABLE (CReplayLogger)
 

Private Attributes

const ScriptInterfacem_ScriptInterface
 
std::ostream * m_Stream
 
OsPath m_Directory
 

Detailed Description

Implementation of IReplayLogger that saves data to a file in the logs directory.

Constructor & Destructor Documentation

◆ CReplayLogger()

CReplayLogger::CReplayLogger ( const ScriptInterface scriptInterface)

◆ ~CReplayLogger()

CReplayLogger::~CReplayLogger ( )

Member Function Documentation

◆ GetDirectory()

OsPath CReplayLogger::GetDirectory ( ) const
virtual

Remember the directory containing the commands.txt file, so that we can save additional files to it.

Implements IReplayLogger.

◆ Hash()

void CReplayLogger::Hash ( const std::string &  hash,
bool  quick 
)
virtual

Optional hash of simulation state (for sync checking).

Implements IReplayLogger.

◆ NONCOPYABLE()

CReplayLogger::NONCOPYABLE ( CReplayLogger  )
private

◆ SaveMetadata()

void CReplayLogger::SaveMetadata ( const CSimulation2 simulation)
virtual

Saves metadata.json containing part of the simulation state used for the summary screen.

Implements IReplayLogger.

◆ StartGame()

void CReplayLogger::StartGame ( JS::MutableHandleValue  attribs)
virtual

Started the game with the given game attributes.

Implements IReplayLogger.

◆ Turn()

void CReplayLogger::Turn ( u32  n,
u32  turnLength,
std::vector< SimulationCommand > &  commands 
)
virtual

Run the given turn with the given collection of player commands.

Implements IReplayLogger.

Member Data Documentation

◆ m_Directory

OsPath CReplayLogger::m_Directory
private

◆ m_ScriptInterface

const ScriptInterface& CReplayLogger::m_ScriptInterface
private

◆ m_Stream

std::ostream* CReplayLogger::m_Stream
private

The documentation for this class was generated from the following files: