Dialogue-owned facade for world reads, unified conditions, and mutations. 更多...
#include <DialogueState.h>
Public 成员函数 | |
| DialogueStateContext (std::string subject={}) | |
| Construct a context for one stable world subject. | |
| void | setSubject (std::string subject) |
| Set the subject used for all future condition queries. | |
| const std::string & | subject () const noexcept |
| Return the currently selected subject id. | |
| void | setQueryProvider (eve::IStateQuery *provider) noexcept |
| Bind a borrowed query provider for this context's lifetime. | |
| void | setMutationProvider (eve::IStateMutation *provider) noexcept |
| Bind a borrowed mutation provider for this context's lifetime. | |
| void | setPolicyEvaluator (std::function< std::optional< eve::condition::ConditionResult >(std::string_view, const eve::Value &)> evaluator) |
| Install a read-only policy evaluator used by PolicyCall conditions. | |
| std::optional< eve::Value > | value (std::string_view key) const |
| Query a canonical world value without creating a local copy in Dialogue. | |
| std::optional< bool > | hasTag (std::string_view tag) const |
| Query exact world tag membership. | |
| std::optional< eve::Value > | attribute (std::string_view key) const |
| Query one attribute or reputation value. | |
| std::optional< eve::Value > | resource (std::string_view key) const |
| Query one resource value. | |
| std::optional< eve::Value > | state (std::string_view key) const |
| Query one persistent state value. | |
| eve::Result< eve::condition::Condition > | compileCondition (const eve::Value &specification) const |
| Compile a canonical condition specification to condition::Condition. | |
| eve::condition::ConditionResult | evaluate (const eve::condition::Condition &condition) const |
| Evaluate an already compiled shared condition with explanation. | |
| eve::condition::ConditionResult | evaluate (const eve::Value &specification) const |
| Compile and evaluate a canonical condition specification. | |
| eve::Result< eve::MutationReceipt > | apply (std::span< const eve::StateMutation > mutations, const eve::MutationContext &context) const |
| Apply a complete mutation set through one authoritative provider. | |
详细描述
Dialogue-owned facade for world reads, unified conditions, and mutations.
Dialogue owns only this borrowed boundary and never mirrors world flags, attributes, reputation, or persistent values. Local conversation variables remain in dnut::SequenceRuntime frames. Mutation providers must implement the all-or-nothing contract; persistent providers are expected to use StatePatch's transaction participant internally.
在文件 DialogueState.h 第 124 行定义.
构造及析构函数说明
◆ DialogueStateContext()
|
explicit |
Construct a context for one stable world subject.
在文件 DialogueState.cpp 第 283 行定义.
成员函数说明
◆ apply()
| eve::Result< eve::MutationReceipt > eve::dialogue::DialogueStateContext::apply | ( | std::span< const eve::StateMutation > | mutations, |
| const eve::MutationContext & | context | ||
| ) | const |
Apply a complete mutation set through one authoritative provider.
在文件 DialogueState.cpp 第 342 行定义.
◆ attribute()
| std::optional< eve::Value > eve::dialogue::DialogueStateContext::attribute | ( | std::string_view | key | ) | const |
Query one attribute or reputation value.
在文件 DialogueState.cpp 第 304 行定义.
引用了 eve::condition::attrKey(), context , 以及 key.
◆ compileCondition()
| eve::Result< eve::condition::Condition > eve::dialogue::DialogueStateContext::compileCondition | ( | const eve::Value & | specification | ) | const |
Compile a canonical condition specification to condition::Condition.
在文件 DialogueState.cpp 第 320 行定义.
被这些函数引用 evaluate().
◆ evaluate() [1/2]
| eve::condition::ConditionResult eve::dialogue::DialogueStateContext::evaluate | ( | const eve::condition::Condition & | condition | ) | const |
Evaluate an already compiled shared condition with explanation.
在文件 DialogueState.cpp 第 324 行定义.
被这些函数引用 eve::dialogue::DialogueFlow::configureIntegration() , 以及 evaluate().
◆ evaluate() [2/2]
| eve::condition::ConditionResult eve::dialogue::DialogueStateContext::evaluate | ( | const eve::Value & | specification | ) | const |
Compile and evaluate a canonical condition specification.
在文件 DialogueState.cpp 第 329 行定义.
引用了 compileCondition(), condition, eve::Diagnostic::error(), evaluate(), eve::condition::ConditionResult::failed(), eve::condition::InvalidCondition, eve::Diagnostic::message() , 以及 message.
◆ hasTag()
| std::optional< bool > eve::dialogue::DialogueStateContext::hasTag | ( | std::string_view | tag | ) | const |
Query exact world tag membership.
在文件 DialogueState.cpp 第 298 行定义.
引用了 result, tag, eve::condition::tagKey() , 以及 eve::dialogue::StateEvaluationContext::value().
◆ resource()
| std::optional< eve::Value > eve::dialogue::DialogueStateContext::resource | ( | std::string_view | key | ) | const |
Query one resource value.
在文件 DialogueState.cpp 第 310 行定义.
引用了 key, eve::condition::resourceKey() , 以及 eve::dialogue::StateEvaluationContext::value().
◆ setMutationProvider()
|
inlinenoexcept |
Bind a borrowed mutation provider for this context's lifetime.
在文件 DialogueState.h 第 136 行定义.
引用了 provider.
被这些函数引用 eve::dialogue::DialogueFlow::configureIntegration().
◆ setPolicyEvaluator()
|
inline |
Install a read-only policy evaluator used by PolicyCall conditions.
在文件 DialogueState.h 第 138 行定义.
◆ setQueryProvider()
|
inlinenoexcept |
Bind a borrowed query provider for this context's lifetime.
在文件 DialogueState.h 第 134 行定义.
引用了 provider.
被这些函数引用 eve::dialogue::DialogueFlow::configureIntegration().
◆ setSubject()
| void eve::dialogue::DialogueStateContext::setSubject | ( | std::string | subject | ) |
Set the subject used for all future condition queries.
在文件 DialogueState.cpp 第 285 行定义.
引用了 subject().
被这些函数引用 eve::dialogue::DialogueFlow::configureIntegration().
◆ state()
| std::optional< eve::Value > eve::dialogue::DialogueStateContext::state | ( | std::string_view | key | ) | const |
Query one persistent state value.
在文件 DialogueState.cpp 第 314 行定义.
引用了 context, key , 以及 eve::condition::stateKey().
◆ subject()
|
inlinenoexcept |
◆ value()
| std::optional< eve::Value > eve::dialogue::DialogueStateContext::value | ( | std::string_view | key | ) | const |
Query a canonical world value without creating a local copy in Dialogue.
在文件 DialogueState.cpp 第 293 行定义.
该类的文档由以下文件生成:
- src/modules/dialogue/DialogueState.h
- src/modules/dialogue/DialogueState.cpp