18#ifndef INCLUDED_VISUAL_REPLAY
19#define INCLUDED_VISUAL_REPLAY
Abstraction around a SpiderMonkey JS::Realm.
Definition: ScriptInterface.h:72
Contains functions for visually replaying past games.
Definition: VisualReplay.h:31
OsPath GetDirectoryPath()
Returns the absolute path to the sim-log directory (that contains the directories with the replay fil...
Definition: VisualReplay.cpp:47
JS::Value LoadReplayData(const ScriptInterface &scriptInterface, const OsPath &directory)
Parses a commands.txt file and extracts metadata.
Definition: VisualReplay.cpp:341
bool HasReplayMetadata(const OsPath &directoryName)
Returns whether or not the metadata / summary screen data has been saved properly when the game ended...
Definition: VisualReplay.cpp:479
JS::Value GetReplayAttributes(const ScriptInterface &scriptInterface, const OsPath &directoryName)
Returns the parsed header of the replay file (commands.txt).
Definition: VisualReplay.cpp:435
OsPath GetCacheFilePath()
Returns the absolute path to the replay cache file.
Definition: VisualReplay.cpp:52
void StoreCacheFile(const ScriptInterface &scriptInterface, JS::HandleObject replays)
Stores the replay list in the replay cache file.
Definition: VisualReplay.cpp:102
void AddReplayToCache(const ScriptInterface &scriptInterface, const CStrW &directoryName)
Adds a replay to the replayCache.
Definition: VisualReplay.cpp:459
bool DeleteReplay(const OsPath &replayFile)
Permanently deletes the visual replay (including the parent directory)
Definition: VisualReplay.cpp:426
bool StartVisualReplay(const OsPath &directory)
Replays the commands.txt file in the given subdirectory visually.
Definition: VisualReplay.cpp:62
JS::Value GetReplays(const ScriptInterface &scriptInterface, bool compareFiles)
Get a list of replays to display in the GUI.
Definition: VisualReplay.cpp:236
bool ReadCacheFile(const ScriptInterface &scriptInterface, JS::MutableHandleObject cachedReplaysObject)
Reads the replay Cache file and parses it into a jsObject.
Definition: VisualReplay.cpp:77
OsPath GetTempCacheFilePath()
Returns the absolute path to the temporary replay cache file used to always have a valid cache file i...
Definition: VisualReplay.cpp:57
JS::HandleObject ReloadReplayCache(const ScriptInterface &scriptInterface, bool compareFiles)
Load the replay cache and check if there are new/deleted replays.
Definition: VisualReplay.cpp:116
JS::Value GetReplayMetadata(const ScriptInterface &scriptInterface, const OsPath &directoryName)
Returns the metadata of a replay.
Definition: VisualReplay.cpp:492
Config::Value_type Value
Definition: json_spirit_value.h:182