载入中...
搜索中...
未找到
WorldState.cpp
浏览该文件的文档.
33 eve::DiagnosticCode::InvalidArgument, "world-state IDs must be non-empty, bounded, and control-free",
36 eve::DiagnosticCode::InvalidArgument, "world-state IDs must be non-empty, bounded, and control-free",
46 eve::DiagnosticCode::InvalidArgument, "world-state IDs must be non-empty, bounded, and control-free",
49 eve::DiagnosticCode::InvalidArgument, "world-state IDs must be non-empty, bounded, and control-free",
全局游戏状态:开关(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
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
double getSelfVariable(const std::string &scope, const std::string &name) const
Returns the self variable.
Definition GameState.cpp:75
bool hasSelfVariable(const std::string &scope, const std::string &name) const
True when self variable.
Definition GameState.cpp:82
void setSelfVariable(const std::string &scope, const std::string &name, double value)
独立变量:scope(如 "map:1:event:3")下按名字存数字。
Definition GameState.cpp:71
eve::Result< void > resetObject(std::string_view mapId, std::string_view objectId)
Idempotently clear the consumed fact for one stable map object.
Definition WorldState.cpp:44
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
@ NoOp
@ Applied