#pragma once #include #include #include #include #include #include "Tick.h" struct Command; struct ReplayHeader { int version = 0; std::string build; unsigned int seed = 0; std::string configHash; std::string timestamp; }; // One entry of the replay stream: either a command (applied at its tick) or an // RNG checksum (verified at its tick). Entries are kept in file order, which is // the canonical order the playback driver reproduces. struct ReplayEntry { Tick tick = 0; bool isCommand = false; std::shared_ptr command; // set iff isCommand std::uint64_t fingerprint = 0; // set iff !isCommand }; struct ParsedReplay { ReplayHeader header; std::vector entries; }; // Parses a replay file (header + command/checksum stream). Returns nullopt on an // I/O failure or malformed content (e.g. an unparseable command line). std::optional readReplayFile(const std::string& path);