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

Stateless codec for the authoritative state of one battle. 更多...

#include <TacticsPersistence.h>

静态 Public 成员函数

static Result< SnapshotEnvelope > snapshot (Battle &battle, const SnapshotHashProvider &hashProvider)
 Capture a version-one, integrity-sealed battle snapshot.
 
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 第 23 行定义.

成员函数说明

◆ 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 第 1266 行定义.

引用了 eve::Result< T >::success() , 以及 values.

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

◆ 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 第 1280 行定义.

引用了 value.

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

◆ restore()

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

◆ snapshot()

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

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