载入中...
搜索中...
未找到
LevelSystem.cpp
浏览该文件的文档.
38eve::Result<void> LevelSystem::restoreProgression(RPGActor *actor, int level, double xp, double xpToNext) {
82 eve::DiagnosticCode::InvariantViolation, "actor progression is not valid for XP gain", "progression"));
121 eve::DiagnosticCode::Conflict, "actor progression changed after XP preparation", "progression"));
角色成长:等级 / 经验 / 升级。
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
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< 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 void pollLevelUps(std::vector< LevelUpEvent > &out)
取出并清空自上次调用以来累积的升级事件(push/poll 风格)。
Definition LevelSystem.cpp:136
static eve::Result< int > commitGainXp(PreparedProgressionGain prepared)
Commit a prepared XP gain if actor progression is still unchanged.
Definition LevelSystem.cpp:113
static eve::Result< void > restoreProgression(RPGActor *actor, int level, double xp, double xpToNext)
Atomically restore one validated progression checkpoint.
Definition LevelSystem.cpp:38
static bool gainXp(RPGActor *actor, double amount, double xpGrowth=1.2)
增加经验;每跨过阈值升一级并发出 LevelUpEvent(compatibility facade (脚本兼容门面))。
Definition LevelSystem.cpp:60
Move-only progression gain prepared against one actor revision.
Definition LevelSystem.h:25
@ InvalidArgument
@ PreconditionViolation
@ InvariantViolation
@ Conflict
@ Pending
@ Applied