载入中...
搜索中...
未找到
StateAccessAdapter.cpp
浏览该文件的文档.
10eve::Result<eve::MutationReceipt> failure(eve::DiagnosticCode code, std::string message, std::string path = {}) {
33std::optional<eve::Value> AttributeSetStateAdapter::value(std::string_view subject, std::string_view key) const {
38std::optional<eve::Value> AttributeSetStateAdapter::attribute(std::string_view subject, std::string_view key) const {
42std::optional<eve::Value> AttributeSetStateAdapter::state(std::string_view subject, std::string_view key) const {
46eve::Result<eve::MutationReceipt> AttributeSetStateAdapter::apply(std::span<const eve::StateMutation> mutations,
63 return failure(eve::DiagnosticCode::InvalidArgument, "attribute mutation value must be a finite number",
AttributeSet implementation of the common world-state contracts.
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
std::optional< eve::Value > attribute(std::string_view subject, std::string_view key) const override
Query a numeric or structured attribute.
Definition StateAccessAdapter.cpp:38
std::optional< eve::Value > state(std::string_view subject, std::string_view key) const override
Query a persistent/world state value.
Definition StateAccessAdapter.cpp:42
std::optional< eve::Value > value(std::string_view subject, std::string_view key) const override
Query a generic world value.
Definition StateAccessAdapter.cpp:33
eve::Result< eve::MutationReceipt > apply(std::span< const eve::StateMutation > mutations, const eve::MutationContext &context) override
Apply a complete mutation set atomically.
Definition StateAccessAdapter.cpp:46
Generic owning collection of canonical attributes and modifiers.
Definition AttributeSet.h:160
double getFinal(const AttributeId &attribute, double fallback=0.0, const AttributeOperationRegistry *customOperations=nullptr) const
Return the deterministic final value after all modifiers.
Definition AttributeSet.cpp:236
void modifyBase(const AttributeId &attribute, double delta)
Add delta to a base value, creating it from zero when absent.
Definition AttributeSet.cpp:219
void setBase(const AttributeId &attribute, double value)
Set or replace a base value. Empty attribute ids are ignored for compatibility.
Definition AttributeSet.cpp:211
bool has(const AttributeId &attribute) const
Return whether a base value or modifier names the attribute.
Definition AttributeSet.cpp:227
Definition AttributeProjection.cpp:9
@ InvalidArgument
@ Unsupported
@ NoOp
@ Applied
Correlation metadata shared by a mutation transaction.
Definition StateAccess.h:57
Observable result of an all-or-nothing mutation request.
Definition StateAccess.h:64