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::decision::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::decision::Condition > | compileCondition (const eve::Value &specification) const |
| Compile a canonical condition specification to decision::Condition. | |
| eve::decision::ConditionResult | evaluate (const eve::decision::Condition &condition) const |
| Evaluate an already compiled shared condition with explanation. | |
| eve::decision::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 第 139 行定义.
构造及析构函数说明
◆ DialogueStateContext()
|
explicit |
Construct a context for one stable world subject.
在文件 DialogueState.cpp 第 297 行定义.
成员函数说明
◆ 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 第 353 行定义.
引用了 eve::state::IStateMutation::apply() , 以及 context.
◆ attribute()
| std::optional< eve::Value > eve::dialogue::DialogueStateContext::attribute | ( | std::string_view | key | ) | const |
◆ compileCondition()
| eve::Result< eve::decision::Condition > eve::dialogue::DialogueStateContext::compileCondition | ( | const eve::Value & | specification | ) | const |
Compile a canonical condition specification to decision::Condition.
在文件 DialogueState.cpp 第 332 行定义.
被这些函数引用 evaluate().
◆ evaluate() [1/2]
| eve::decision::ConditionResult eve::dialogue::DialogueStateContext::evaluate | ( | const eve::decision::Condition & | condition | ) | const |
Evaluate an already compiled shared condition with explanation.
在文件 DialogueState.cpp 第 336 行定义.
被这些函数引用 eve::dialogue::DialogueFlow::configureIntegration() , 以及 evaluate().
◆ evaluate() [2/2]
| eve::decision::ConditionResult eve::dialogue::DialogueStateContext::evaluate | ( | const eve::Value & | specification | ) | const |
Compile and evaluate a canonical condition specification.
在文件 DialogueState.cpp 第 341 行定义.
引用了 compileCondition(), condition, eve::Diagnostic::error(), evaluate(), eve::decision::ConditionResult::failed(), eve::decision::InvalidCondition, eve::Diagnostic::message() , 以及 message.
◆ hasTag()
| std::optional< bool > eve::dialogue::DialogueStateContext::hasTag | ( | std::string_view | tag | ) | const |
◆ resource()
| std::optional< eve::Value > eve::dialogue::DialogueStateContext::resource | ( | std::string_view | key | ) | const |
◆ setMutationProvider()
|
inlinenoexcept |
Bind a borrowed mutation provider for this context's lifetime.
在文件 DialogueState.h 第 151 行定义.
被这些函数引用 eve::dialogue::DialogueFlow::configureIntegration().
◆ setPolicyEvaluator()
|
inline |
Install a read-only policy evaluator used by PolicyCall conditions.
在文件 DialogueState.h 第 153 行定义.
◆ setQueryProvider()
|
inlinenoexcept |
Bind a borrowed query provider for this context's lifetime.
在文件 DialogueState.h 第 149 行定义.
被这些函数引用 eve::dialogue::DialogueFlow::configureIntegration().
◆ setSubject()
| void eve::dialogue::DialogueStateContext::setSubject | ( | std::string | subject | ) |
Set the subject used for all future condition queries.
在文件 DialogueState.cpp 第 299 行定义.
引用了 subject().
被这些函数引用 eve::dialogue::DialogueFlow::configureIntegration().
◆ state()
| std::optional< eve::Value > eve::dialogue::DialogueStateContext::state | ( | std::string_view | key | ) | const |
◆ 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 第 307 行定义.
该类的文档由以下文件生成:
- src/modules/dialogue/DialogueState.h
- src/modules/dialogue/DialogueState.cpp