载入中...
搜索中...
未找到
TacticsPersistence.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
7#include "common/Snapshot.h"
10
11#include <memory>
12#include <string_view>
13
14namespace eve::tactics {
15
25public:
28 public:
31 PreparedRestore& operator=(PreparedRestore&&) noexcept;
33 PreparedRestore& operator=(const PreparedRestore&) = delete;
34
35 private:
36 friend class TacticsPersistence;
37 struct Impl;
38 explicit PreparedRestore(std::unique_ptr<Impl> state);
39 std::unique_ptr<Impl> state_;
40 };
41
43 [[nodiscard]] static Result<SnapshotEnvelope> snapshot(Battle& battle,
44 const SnapshotHashProvider& hashProvider);
51 [[nodiscard]] static Result<PreparedRestore> prepareRestore(Battle& battle, const SnapshotEnvelope& snapshot,
52 const SnapshotHashProvider& hashProvider);
54 static void commitPrepared(PreparedRestore prepared) noexcept;
56 [[nodiscard]] static Result<void> restore(Battle& battle, const SnapshotEnvelope& snapshot,
57 const SnapshotHashProvider& hashProvider);
58
67 [[nodiscard]] static Result<Value> commandLogValue(Battle& battle, Revision fromRevision);
68
78 [[nodiscard]] static Result<Battle::Commands> parseCommandLog(const Value& value, Revision snapshotRevision);
79};
80
81} // namespace eve::tactics
#define EVENGINE_API_DOMAINS
Definition Export.h:110
Object::Ptr value
Versioned, integrity-checked persistence envelopes.
Deterministic accepted-command replay.
Deterministic board values and short-root ECS entities for tactics.
Move-only operation result carrying either a value or Status.
Definition Result.h:176
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
Battle short-root and authoritative owner of board and turn state.
Fully validated battle candidate awaiting a no-fail publication.
PreparedRestore(PreparedRestore &&) noexcept
Stateless codec for the authoritative state of one battle.
std::function< Result< ContentId >(std::string_view canonicalInput)> SnapshotHashProvider
Injected content-digest implementation used by snapshots.
Definition Snapshot.h:36
Stable outer format shared by persistence and cross-process snapshots.
Definition Snapshot.h:46