Changeset View
Changeset View
Standalone View
Standalone View
source/ps/VisualReplay.h
Context not available. | |||||
#define INCLUDED_REPlAY | #define INCLUDED_REPlAY | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
#include "lib/os_path.h" | |||||
class CSimulation2; | class CSimulation2; | ||||
class CGUIManager; | class CGUIManager; | ||||
Context not available. | |||||
bool DeleteReplay(const OsPath& replayFile); | bool DeleteReplay(const OsPath& replayFile); | ||||
/** | /** | ||||
* Sets attribs to the parsed header of the replay file `replayStream`. | |||||
* | |||||
* Returns true upon success; | |||||
*/ | |||||
bool ParseHeader(const ScriptInterface& scriptInterface, JS::MutableHandleValue attribs, std::istream* replayStream, std::string identifier, bool full); | |||||
/** | |||||
* Returns the parsed header of the replay file (commands.txt). | * Returns the parsed header of the replay file (commands.txt). | ||||
*/ | */ | ||||
JS::Value GetReplayAttributes(ScriptInterface::CxPrivate* pCxPrivate, const OsPath& directoryName); | JS::Value GetReplayAttributes(ScriptInterface::CxPrivate* pCxPrivate, const OsPath& directoryName); | ||||
Context not available. | |||||
* Adds a replay to the replayCache. | * Adds a replay to the replayCache. | ||||
*/ | */ | ||||
void AddReplayToCache(const ScriptInterface& scriptInterface, const CStrW& directoryName); | void AddReplayToCache(const ScriptInterface& scriptInterface, const CStrW& directoryName); | ||||
/** | |||||
* Compute game duration in seconds. Assume constant turn length. | |||||
* Find the last line that starts with "turn" by reading the file backwards. | |||||
* | |||||
* @return seconds or -1 on error | |||||
*/ | |||||
int GetReplayDuration(std::istream* replayStream, std::string& identifier, off_t fileSize); | |||||
} | } | ||||
#endif | #endif | ||||
Context not available. |
Wildfire Games · Phabricator