载入中...
搜索中...
未找到
BattleVictory.cpp
浏览该文件的文档.
Atomic post-battle progression and persistent-world settlement.
职业系统:设定职业、施加职业基础特征、按等级自动学习技能。
全局游戏状态:开关(bool)、变量(数字)、独立变量(按作用域)。
角色成长:等级 / 经验 / 升级。
目标追踪器运行时实例(玩家日志 / 成就 / 教程可各建一份)。
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
bool ok() const noexcept
Whether this result represents a non-failure outcome.
Definition Result.h:480
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
static eve::Result< BattleVictoryReceipt > settle(RPGActor &actor, GameState &gameState, Tracker &tracker, const BattleVictoryRequest &request)
Atomically settle XP, derived class skills, attributes, quest progress, and encounter consumption.
Definition BattleVictory.cpp:45
eve::Result< void > restoreSnapshotJson(std::string_view json)
Validate and atomically restore a canonical RPG game-state JSON document.
Definition GameState.cpp:146
eve::Result< std::string > snapshotJson() const
Serialize this state as the canonical versioned RPG game-state JSON document.
Definition GameState.cpp:119
static eve::Result< PreparedProgressionGain > prepareGainXp(RPGActor *actor, double amount, double xpGrowth=1.2)
Validate an XP gain and calculate its complete progression candidate without mutation/events.
Definition LevelSystem.cpp:67
static eve::Result< int > commitGainXp(PreparedProgressionGain prepared)
Commit a prepared XP gain if actor progression is still unchanged.
Definition LevelSystem.cpp:113
Move-only progression gain prepared against one actor revision.
Definition LevelSystem.h:25
int levelsGained() const noexcept
Number of level transitions contained in this prepared candidate.
Definition LevelSystem.h:30
std::unordered_map< std::string, QuestRuntime > entries
运行时条目(QuestSystem 读写;公开以便测试与脚本查询)。
Definition Tracker.h:123
void notify(const std::string &topic, const std::string &target, int amount)
Notify.
Definition Tracker.cpp:25
Non-owning typed adapter for persistent per-map object lifecycle state.
Definition WorldState.h:19
bool isObjectConsumed(std::string_view mapId, std::string_view objectId) const
Query whether a stable object has been consumed in one map.
Definition WorldState.cpp:23
eve::Result< void > consumeObject(std::string_view mapId, std::string_view objectId)
Idempotently publish the consumed fact for one stable map object.
Definition WorldState.cpp:31
@ InvalidArgument
@ PreconditionViolation
@ InvariantViolation
@ Conflict
@ Applied
Observable summary returned after a complete victory settlement.
Definition BattleVictory.h:39
Complete data needed to settle one victorious persistent encounter.
Definition BattleVictory.h:21