载入中...
搜索中...
未找到
eve::tactics::TacticsPersistence类 参考

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()

Result< Value > eve::tactics::TacticsPersistence::commandLogValue ( Battle &  battle,
Revision  fromRevision 
)
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.

被这些函数引用 eve::tactics::Tactics::commandLogJson().

◆ commitPrepared()

void eve::tactics::TacticsPersistence::commitPrepared ( PreparedRestore  prepared)
staticnoexcept

Publish a previously prepared battle state without further fallible work.

在文件 TacticsPersistence.cpp 第 1345 行定义.

引用了 turn , 以及 unit.

被这些函数引用 restore().

◆ parseCommandLog()

Result< Battle::Commands > eve::tactics::TacticsPersistence::parseCommandLog ( const Value &  value,
Revision  snapshotRevision 
)
static

Parse a command log written by commandLogValue.

参数
valueOwning command-log object.
snapshotRevisionRevision 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()

Result< TacticsPersistence::PreparedRestore > eve::tactics::TacticsPersistence::prepareRestore ( Battle &  battle,
const SnapshotEnvelope &  snapshot,
const SnapshotHashProvider &  hashProvider 
)
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()

Result< void > eve::tactics::TacticsPersistence::restore ( Battle &  battle,
const SnapshotEnvelope &  snapshot,
const SnapshotHashProvider &  hashProvider 
)
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()

Result< SnapshotEnvelope > eve::tactics::TacticsPersistence::snapshot ( Battle &  battle,
const SnapshotHashProvider &  hashProvider 
)
static

该类的文档由以下文件生成: