载入中...
搜索中...
未找到
StateAccessAdapter.h
浏览该文件的文档.
1#pragma once
2
10
11namespace eve::attributes {
12
22public:
24 explicit AttributeSetStateAdapter(AttributeSet& attributes) noexcept : attributes_(attributes) {}
25
28 [[nodiscard]] std::optional<eve::Value> value(std::string_view subject, std::string_view key) const override;
31 [[nodiscard]] std::optional<bool> hasTag(std::string_view, std::string_view) const override { return std::nullopt; }
34 [[nodiscard]] std::optional<eve::Value> attribute(std::string_view subject, std::string_view key) const override;
37 [[nodiscard]] std::optional<eve::Value> resource(std::string_view, std::string_view) const override {
38 return std::nullopt;
39 }
42 [[nodiscard]] std::optional<eve::Value> state(std::string_view subject, std::string_view key) const override;
45 [[nodiscard]] std::optional<bool> authority(std::string_view, std::string_view) const override {
46 return std::nullopt;
47 }
48
51 [[nodiscard]] eve::Result<eve::MutationReceipt> apply(std::span<const eve::StateMutation> mutations,
52 const eve::MutationContext& context) override;
53
54private:
55 bool owns(std::string_view subject) const noexcept;
56 AttributeSet& attributes_;
57};
58
59} // namespace eve::attributes
double value
int subject
Definition AnimSmr.cpp:163
std::uint32_t key
Consumer-owned query and mutation contracts for authoritative world state.
const VegetationPresetContext & context
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Adapts one AttributeSet to numeric world reads and volatile writes.
std::optional< eve::Value > attribute(std::string_view subject, std::string_view key) const override
Query a numeric or structured attribute.
AttributeSetStateAdapter(AttributeSet &attributes) noexcept
Bind a borrowed authoritative set for one subject.
std::optional< bool > hasTag(std::string_view, std::string_view) const override
Query exact tag membership.
eve::Result< eve::MutationReceipt > apply(std::span< const eve::StateMutation > mutations, const eve::MutationContext &context) override
Apply a complete mutation set atomically.
std::optional< bool > authority(std::string_view, std::string_view) const override
Query read-only authority for a scope.
std::optional< eve::Value > resource(std::string_view, std::string_view) const override
Query a resource value or marker.
Generic owning collection of canonical attributes and modifiers.
All-or-nothing mutation boundary owned by the consumer.
Read-only world-state boundary owned by consumers such as Dialogue.
Definition StateAccess.h:79
Correlation metadata shared by a mutation transaction.
Definition StateAccess.h:57