Stateless codec for the authoritative state of one battle. 更多...
#include <TacticsPersistence.h>
类 | |
| class | PreparedRestore |
| Fully validated battle candidate awaiting a no-fail publication. 更多... | |
静态 Public 成员函数 | |
| static Result< SnapshotEnvelope > | snapshot (Battle &battle, const SnapshotHashProvider &hashProvider) |
| Capture a version-one, integrity-sealed battle snapshot. | |
| static Result< PreparedRestore > | prepareRestore (Battle &battle, const SnapshotEnvelope &snapshot, const SnapshotHashProvider &hashProvider) |
| Verify and resolve a battle snapshot without changing live state. @thread Owning simulation thread; battle and registries must remain stable until commit. @reentrancy No callbacks or scripts are invoked. @cost Comparable to a full battle restore; once per load, not per frame. | |
| static void | commitPrepared (PreparedRestore prepared) noexcept |
| Publish a previously prepared battle state without further fallible work. | |
| static Result< void > | restore (Battle &battle, const SnapshotEnvelope &snapshot, const SnapshotHashProvider &hashProvider) |
| Restore a verified compatible snapshot without partial mutation on failure. | |
| static Result< Value > | commandLogValue (Battle &battle, Revision fromRevision) |
Serialize the accepted command log after fromRevision in its persisted shape. | |
| static Result< Battle::Commands > | parseCommandLog (const Value &value, Revision snapshotRevision) |
| Parse a command log written by commandLogValue. | |
详细描述
Stateless codec for the authoritative state of one battle.
Runtime ECS handles never cross the persistence boundary. Restore resolves stable SubjectRef values against the target battle, constructs and validates all candidate values first, and only then replaces mutable components. Methods are simulation-thread-affine and invoke no unknown callbacks.
在文件 TacticsPersistence.h 第 24 行定义.
成员函数说明
◆ commandLogValue()
|
static |
Serialize the accepted command log after fromRevision in its persisted shape.
- 返回
- The same
{nextSequence, values: [...]}object a snapshot payload carries, which is what makes it replayable by parseCommandLog. Callers that only want to display a log use the projected script shape instead; this one exists so replay does not need a second, second-guessed parser.
在文件 TacticsPersistence.cpp 第 1282 行定义.
引用了 eve::Result< T >::success() , 以及 values.
◆ commitPrepared()
|
staticnoexcept |
Publish a previously prepared battle state without further fallible work.
在文件 TacticsPersistence.cpp 第 1345 行定义.
被这些函数引用 restore().
◆ parseCommandLog()
|
static |
Parse a command log written by commandLogValue.
- 参数
-
value Owning command-log object. snapshotRevision Revision the log must end at, so a log replayed onto the wrong battle state is refused instead of silently re-applied.
- 返回
- The commands, or a structured parse/ordering failure.
- 备注
- Uses the current schema's command shape, exactly like restore: one parser owns the persisted command format.
在文件 TacticsPersistence.cpp 第 1296 行定义.
引用了 value.
被这些函数引用 eve::tactics::Tactics::replayJson().
◆ prepareRestore()
|
static |
Verify and resolve a battle snapshot without changing live state. @thread Owning simulation thread; battle and registries must remain stable until commit. @reentrancy No callbacks or scripts are invoked. @cost Comparable to a full battle restore; once per load, not per frame.
在文件 TacticsPersistence.cpp 第 1314 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, source, state, eve::Result< T >::success(), eve::UnknownVersion, eve::validateSnapshotPayloadMetadata() , 以及 eve::verifySnapshotEnvelope().
被这些函数引用 eve::tactics::TacticsGameSaveParticipant::prepare() , 以及 restore().
◆ restore()
|
static |
Restore a verified compatible snapshot without partial mutation on failure.
在文件 TacticsPersistence.cpp 第 1306 行定义.
引用了 eve::Applied, commitPrepared(), eve::Result< T >::failure(), prepareRestore(), source, eve::Status::success() , 以及 eve::Result< T >::success().
被这些函数引用 eve::tactics::Tactics::restore() , 以及 eve::tactics::Tactics::restoreJson().
◆ snapshot()
|
static |
Capture a version-one, integrity-sealed battle snapshot.
在文件 TacticsPersistence.cpp 第 1184 行定义.
引用了 active, cells, commands, edges, eve::Diagnostic::error(), events, eve::tactics::ExplicitGraph, eve::Result< T >::failure(), handle, key, eve::makeSnapshotEnvelope(), objectives, payload, record, schedule, sides, eve::StaleHandle, tag, tags, unit, units , 以及 version.
被这些函数引用 eve::tactics::TacticsGameSaveParticipant::capture(), eve::tactics::Tactics::snapshot() , 以及 eve::tactics::Tactics::snapshotJson().
该类的文档由以下文件生成:
- src/modules/tactics/TacticsPersistence.h
- src/modules/tactics/TacticsPersistence.cpp