Pyrogenesis
trunk
|
Contains functions for visually replaying past games. More...
Functions | |
OsPath | GetDirectoryName () |
Returns the path to the sim-log directory (that contains the directories with the replay files. More... | |
void | StartVisualReplay (const CStrW &directory) |
Replays the commands.txt file in the given subdirectory visually. More... | |
JS::Value | GetReplays (ScriptInterface &scriptInterface) |
Get a list of replays to display in the GUI. More... | |
JS::Value | LoadReplayData (ScriptInterface &scriptInterface, OsPath &directory) |
Parses a commands.txt file and extracts metadata. More... | |
bool | DeleteReplay (const CStrW &replayFile) |
Permanently deletes the visual replay (including the parent directory) More... | |
JS::Value | GetReplayAttributes (ScriptInterface::CxPrivate *pCxPrivate, const CStrW &directoryName) |
Returns the parsed header of the replay file (commands.txt). More... | |
bool | HasReplayMetadata (const CStrW &directoryName) |
Returns whether or not the metadata / summary screen data has been saved properly when the game ended. More... | |
JS::Value | GetReplayMetadata (ScriptInterface::CxPrivate *pCxPrivate, const CStrW &directoryName) |
Returns the metadata of a replay. More... | |
void | SaveReplayMetadata (ScriptInterface *scriptInterface) |
Saves the metadata from the session to metadata.json. More... | |
Contains functions for visually replaying past games.
bool VisualReplay::DeleteReplay | ( | const CStrW & | replayFile | ) |
Permanently deletes the visual replay (including the parent directory)
replayFile | path to commands.txt, whose parent directory will be deleted |
OsPath VisualReplay::GetDirectoryName | ( | ) |
Returns the path to the sim-log directory (that contains the directories with the replay files.
scriptInterface | the ScriptInterface in which to create the return data. |
JS::Value VisualReplay::GetReplayAttributes | ( | ScriptInterface::CxPrivate * | pCxPrivate, |
const CStrW & | directoryName | ||
) |
Returns the parsed header of the replay file (commands.txt).
JS::Value VisualReplay::GetReplayMetadata | ( | ScriptInterface::CxPrivate * | pCxPrivate, |
const CStrW & | directoryName | ||
) |
Returns the metadata of a replay.
JS::Value VisualReplay::GetReplays | ( | ScriptInterface & | scriptInterface | ) |
Get a list of replays to display in the GUI.
Load all replays found in the directory.
scriptInterface | the ScriptInterface in which to create the return data. |
Since files are spread across the harddisk, loading hundreds of them can consume a lot of time.
bool VisualReplay::HasReplayMetadata | ( | const CStrW & | directoryName | ) |
Returns whether or not the metadata / summary screen data has been saved properly when the game ended.
JS::Value VisualReplay::LoadReplayData | ( | ScriptInterface & | scriptInterface, |
OsPath & | directory | ||
) |
Parses a commands.txt file and extracts metadata.
Works similarly to CGame::LoadReplayData().
void VisualReplay::SaveReplayMetadata | ( | ScriptInterface * | scriptInterface | ) |
Saves the metadata from the session to metadata.json.
void VisualReplay::StartVisualReplay | ( | const CStrW & | directory | ) |
Replays the commands.txt file in the given subdirectory visually.