Explain one condition evaluation in a UI- and log-friendly form. 更多...
#include <Condition.h>
Public 成员函数 | |
| bool | passed () const noexcept |
| Whether the condition passed. | |
| ConditionReasonCode | reasonCode () const noexcept |
| Stable machine-readable reason code. | |
| const Value & | evidence () const noexcept |
| Observed value or child evidence owned by this result. | |
| const Value & | details () const noexcept |
| Structured details suitable for UI explanation. | |
静态 Public 成员函数 | |
| static ConditionResult | success (Value evidence={}, Value details=Value::Object{}) |
| Construct a passed result with optional evidence and details. | |
| static ConditionResult | failed (ConditionReasonCode reason, Value evidence={}, Value details=Value::Object{}) |
| Construct a rejected result with a stable reason and explanation. | |
详细描述
Explain one condition evaluation in a UI- and log-friendly form.
evidence is the value observed at the leaf or returned by a policy. details contains stable field names and child explanations. Both values own their storage and remain valid after the evaluation context is gone.
在文件 Condition.h 第 136 行定义.
成员函数说明
◆ details()
|
inlinenoexcept |
Structured details suitable for UI explanation.
在文件 Condition.h 第 151 行定义.
◆ evidence()
|
inlinenoexcept |
Observed value or child evidence owned by this result.
在文件 Condition.h 第 149 行定义.
◆ failed()
|
static |
Construct a rejected result with a stable reason and explanation.
在文件 Condition.cpp 第 135 行定义.
引用了 details() , 以及 evidence().
被这些函数引用 eve::condition::Condition::evaluate(), eve::dialogue::DialogueStateContext::evaluate(), eve::card::Card::evaluatePlay() , 以及 eve::condition::resolveAuthorityAllow().
◆ passed()
|
inlinenoexcept |
Whether the condition passed.
在文件 Condition.h 第 145 行定义.
◆ reasonCode()
|
inlinenoexcept |
Stable machine-readable reason code.
在文件 Condition.h 第 147 行定义.
◆ success()
|
static |
Construct a passed result with optional evidence and details.
在文件 Condition.cpp 第 131 行定义.
引用了 details(), evidence() , 以及 eve::condition::Passed.
被这些函数引用 eve::condition::Condition::evaluate() , 以及 eve::condition::resolveAuthorityAllow().
该类的文档由以下文件生成:
- src/engine/common/Condition.h
- src/engine/common/Condition.cpp