类 | |
| class | Condition |
| Immutable condition AST node. 更多... | |
| class | ConditionResult |
| Explain one condition evaluation in a UI- and log-friendly form. 更多... | |
| class | EvaluationContext |
| Read-only state boundary used by every condition evaluation. 更多... | |
| struct | ScriptConditionDeclaration |
| Metadata a script policy must declare before it is used by a condition. 更多... | |
枚举 | |
| enum class | ConditionKind : std::uint8_t { All , Any , Not , Compare , PolicyCall } |
| Node kind in the side-effect-free condition AST. 更多... | |
| enum class | CompareOperator : std::uint8_t { Equal , NotEqual , Less , LessEqual , Greater , GreaterEqual , Exists } |
| Scalar comparison used by a Compare node. 更多... | |
| enum class | DeterminismLevel : std::uint8_t { BitExact , TickDeterministic , ToleranceBounded , ExplicitlyNondeterministic } |
| Determinism contract declared by a script-backed condition policy. 更多... | |
| enum class | ConditionReasonCode : std::uint32_t { Passed = 0 , ChildFailed = 1 , NoChildPassed = 2 , Negated = 3 , MissingValue = 4 , ValueMismatch = 5 , TagMissing = 6 , TagUnavailable = 7 , AttributeMissing = 8 , ResourceMissing = 9 , StateMissing = 10 , StateMismatch = 11 , AuthorityDenied = 12 , AuthorityUnavailable = 13 , PolicyRejected = 14 , PolicyUnavailable = 15 , InvalidCondition = 16 } |
| Stable machine-readable explanation code for a condition outcome. 更多... | |
函数 | |
| const char * | conditionReasonCodeName (ConditionReasonCode code) noexcept |
| Return the stable lowercase spelling of a condition reason code. @ownership Borrowed process-static text; callers must not free or modify it. @nullable Never null; unknown numeric values use the stable unknown-value literal. @lifetime Process lifetime. @thread Thread-safe and reentrant; no mutable state or callbacks are used. | |
| const char * | conditionKindName (ConditionKind kind) noexcept |
| Return the stable lowercase spelling of a condition node kind. @ownership Borrowed process-static text; callers must not free or modify it. @nullable Never null; unknown numeric values use the stable unknown-value literal. @lifetime Process lifetime. @thread Thread-safe and reentrant; no mutable state or callbacks are used. | |
| const char * | compareOperatorName (CompareOperator op) noexcept |
| Return the stable lowercase spelling of a comparison operator. @ownership Borrowed process-static text; callers must not free or modify it. @nullable Never null; unknown numeric values use the stable unknown-value literal. @lifetime Process lifetime. @thread Thread-safe and reentrant; no mutable state or callbacks are used. | |
| eve::Result< eve::Value > | encodeCondition (const Condition &condition) |
| Encode one validated condition tree as an owning Value. | |
| eve::Result< Condition > | decodeCondition (const eve::Value &value) |
| Decode one condition tree from an owning Value. | |
| std::optional< std::string > | authorityAllowScope (const Value &arguments) |
Extract the scope string from an authority.allow argument object. | |
| std::string | tagKey (std::string_view tag) |
Build a tag:<name> Compare key. | |
| std::string | attrKey (std::string_view name) |
Build an attr:<name> Compare key. | |
| std::string | resourceKey (std::string_view name) |
Build a resource:<name> Compare key. | |
| std::string | stateKey (std::string_view name) |
Build a state:<name> Compare key. | |
| std::string | authorityKey (std::string_view scope) |
Build an authority:<scope> dependency/watch key. | |
| std::optional< std::string_view > | stripPrefix (std::string_view key, std::string_view prefix) |
| Strip a known domain prefix from a key. | |
| Condition | tagPresent (std::string tag) |
Compare that a tag key is present (tag:<name> == true). | |
| Condition | attributeExists (std::string name) |
Compare that an attribute key exists (attr:<name> Exists). | |
| Condition | resourceExists (std::string name) |
Compare that a resource key exists (resource:<name> Exists). | |
| Condition | stateEquals (std::string name, Value expected) |
| Compare that a state key equals an expected value. | |
| Condition | authorityAllow (std::string scope) |
PolicyCall for read-only authority (authority.allow). | |
| template<class AuthorityQuery > | |
| std::optional< ConditionResult > | resolveAuthorityAllow (std::string_view name, const Value &arguments, AuthorityQuery &&authorityQuery) |
Resolve the built-in authority.allow policy when name matches. | |
变量 | |
| constexpr std::string_view | kTagPrefix = "tag:" |
Prefix for tag membership booleans (tag:<name>). | |
| constexpr std::string_view | kAttrPrefix = "attr:" |
Prefix for attribute values (attr:<name>). | |
| constexpr std::string_view | kResourcePrefix = "resource:" |
Prefix for resource values (resource:<name>). | |
| constexpr std::string_view | kStatePrefix = "state:" |
Prefix for state values (state:<name>). | |
| constexpr std::string_view | kAuthorityPrefix = "authority:" |
| Prefix for authority scopes used as watch/dependency keys. | |
| constexpr std::string_view | kPolicyPrefix = "policy:" |
Prefix for policy watch keys (policy:<name>). | |
| constexpr std::string_view | kAuthorityAllowPolicy = "authority.allow" |
| PolicyCall name for read-only authority checks. | |
枚举类型说明
◆ CompareOperator
|
strong |
Scalar comparison used by a Compare node.
| 枚举值 | |
|---|---|
| Equal | |
| NotEqual | |
| Less | |
| LessEqual | |
| Greater | |
| GreaterEqual | |
| Exists | Passes when the keyed value is present; expected is ignored. |
在文件 Condition.h 第 35 行定义.
◆ ConditionKind
|
strong |
Node kind in the side-effect-free condition AST.
| 枚举值 | |
|---|---|
| All | |
| Any | |
| Not | |
| Compare | |
| PolicyCall | |
在文件 Condition.h 第 26 行定义.
◆ ConditionReasonCode
|
strong |
Stable machine-readable explanation code for a condition outcome.
Active evaluation paths emit Passed, ChildFailed, NoChildPassed, Negated, MissingValue, ValueMismatch, PolicyRejected, PolicyUnavailable, AuthorityDenied, AuthorityUnavailable, and InvalidCondition. The remaining codes are retained for snapshot compatibility with older fact stores.
在文件 Condition.h 第 82 行定义.
◆ DeterminismLevel
|
strong |
Determinism contract declared by a script-backed condition policy.
| 枚举值 | |
|---|---|
| BitExact | Same inputs produce the same bits without an external clock. |
| TickDeterministic | Deterministic when evaluated at the injected simulation tick. |
| ToleranceBounded | Results may vary within a documented numeric tolerance. |
| ExplicitlyNondeterministic | Result is intentionally not suitable for replay or lockstep. |
在文件 Condition.h 第 47 行定义.
函数说明
◆ attributeExists()
|
inline |
Compare that an attribute key exists (attr:<name> Exists).
- 参数
-
name Attribute name without prefix.
在文件 ConditionKeys.h 第 106 行定义.
引用了 attrKey(), eve::condition::Condition::compare(), Exists , 以及 name.
◆ attrKey()
|
inline |
Build an attr:<name> Compare key.
- 参数
-
name Non-empty attribute name without a domain prefix.
在文件 ConditionKeys.h 第 49 行定义.
引用了 kAttrPrefix, key , 以及 name.
被这些函数引用 eve::dialogue::DialogueStateContext::attribute() , 以及 attributeExists().
◆ authorityAllow()
|
inline |
PolicyCall for read-only authority (authority.allow).
- 参数
-
scope Authority scope without prefix.
在文件 ConditionKeys.h 第 131 行定义.
引用了 authorityKey(), BitExact, eve::condition::ScriptConditionDeclaration::dependencies, eve::condition::ScriptConditionDeclaration::determinism, kAuthorityAllowPolicy, eve::condition::ScriptConditionDeclaration::name, eve::condition::Condition::policyCall() , 以及 scope.
◆ authorityAllowScope()
| EVENGINE_API_FOUNDATION std::optional< std::string > eve::condition::authorityAllowScope | ( | const Value & | arguments | ) |
Extract the scope string from an authority.allow argument object.
- 参数
-
arguments PolicyCall arguments.
- 返回
- Non-empty scope text, or nullopt when the field is missing/invalid.
在文件 ConditionKeys.cpp 第 5 行定义.
引用了 eve::Value::find() , 以及 eve::Value::getIf().
被这些函数引用 resolveAuthorityAllow().
◆ authorityKey()
|
inline |
Build an authority:<scope> dependency/watch key.
- 参数
-
scope Non-empty authority scope without a domain prefix.
在文件 ConditionKeys.h 第 79 行定义.
引用了 kAuthorityPrefix, key , 以及 scope.
被这些函数引用 authorityAllow().
◆ compareOperatorName()
|
noexcept |
Return the stable lowercase spelling of a comparison operator. @ownership Borrowed process-static text; callers must not free or modify it. @nullable Never null; unknown numeric values use the stable unknown-value literal. @lifetime Process lifetime. @thread Thread-safe and reentrant; no mutable state or callbacks are used.
在文件 Condition.cpp 第 118 行定义.
引用了 Equal, Exists, Greater, GreaterEqual, Less, LessEqual , 以及 NotEqual.
被这些函数引用 encodeCondition().
◆ conditionKindName()
|
noexcept |
Return the stable lowercase spelling of a condition node kind. @ownership Borrowed process-static text; callers must not free or modify it. @nullable Never null; unknown numeric values use the stable unknown-value literal. @lifetime Process lifetime. @thread Thread-safe and reentrant; no mutable state or callbacks are used.
在文件 Condition.cpp 第 107 行定义.
引用了 All, Any, Compare, kind, Not , 以及 PolicyCall.
被这些函数引用 encodeCondition().
◆ conditionReasonCodeName()
|
noexcept |
Return the stable lowercase spelling of a condition reason code. @ownership Borrowed process-static text; callers must not free or modify it. @nullable Never null; unknown numeric values use the stable unknown-value literal. @lifetime Process lifetime. @thread Thread-safe and reentrant; no mutable state or callbacks are used.
在文件 Condition.cpp 第 84 行定义.
引用了 AttributeMissing, AuthorityDenied, AuthorityUnavailable, ChildFailed, code, InvalidCondition, MissingValue, Negated, NoChildPassed, Passed, PolicyRejected, PolicyUnavailable, ResourceMissing, StateMismatch, StateMissing, TagMissing, TagUnavailable , 以及 ValueMismatch.
被这些函数引用 eve::rpg::SkillSystem::canCast(), eve::dialogue::DialogueFlow::configureIntegration() , 以及 eve::card::CardPlayPaymentAdapter::play().
◆ decodeCondition()
| EVENGINE_API_FOUNDATION eve::Result< Condition > eve::condition::decodeCondition | ( | const eve::Value & | value | ) |
Decode one condition tree from an owning Value.
- 参数
-
value Node-shaped Value; legacy leaf kinds are expanded.
- 返回
- Validated condition tree, or a structured parse failure.
在文件 ConditionCodec.cpp 第 298 行定义.
引用了 value.
被这些函数引用 eve::emergence::decodeCondition() , 以及 eve::rpg::decodeSkillCondition().
◆ encodeCondition()
| EVENGINE_API_FOUNDATION eve::Result< eve::Value > eve::condition::encodeCondition | ( | const Condition & | condition | ) |
Encode one validated condition tree as an owning Value.
- 参数
-
condition Immutable condition tree to encode.
- 返回
- Node-shaped Value, or InvalidArgument when the tree is invalid.
在文件 ConditionCodec.cpp 第 258 行定义.
引用了 All, Any, children, Compare, compareOperatorName(), condition, conditionKindName(), encodeCondition(), eve::Diagnostic::error(), Exists, eve::Result< T >::failure(), eve::InvalidArgument, eve::Value::isNull(), eve::Value::kind(), Not, PolicyCall , 以及 eve::Result< T >::success().
被这些函数引用 encodeCondition() , 以及 eve::rpg::encodeSkillCondition().
◆ resolveAuthorityAllow()
| std::optional< ConditionResult > eve::condition::resolveAuthorityAllow | ( | std::string_view | name, |
| const Value & | arguments, | ||
| AuthorityQuery && | authorityQuery | ||
| ) |
Resolve the built-in authority.allow policy when name matches.
- 参数
-
name Policy name from PolicyCall. arguments Policy arguments; requires a non-empty string scope.authorityQuery Returns known grant, or nullopt when the authority source is unavailable for that scope.
- 返回
- A ConditionResult when this is the authority policy; nullopt when
nameis a different policy the caller should handle.
在文件 ConditionKeys.h 第 158 行定义.
引用了 authorityAllowScope(), AuthorityDenied, AuthorityUnavailable, eve::condition::ConditionResult::failed(), InvalidCondition, kAuthorityAllowPolicy, name, scope , 以及 eve::condition::ConditionResult::success().
被这些函数引用 eve::card::CardPlayConditionContext::policy(), eve::dialogue::StateEvaluationContext::policy(), eve::emergence::FactStore::policy() , 以及 eve::rpg::SkillConditionContext::policy().
◆ resourceExists()
|
inline |
Compare that a resource key exists (resource:<name> Exists).
- 参数
-
name Resource name without prefix.
在文件 ConditionKeys.h 第 114 行定义.
引用了 eve::condition::Condition::compare(), Exists, name , 以及 resourceKey().
◆ resourceKey()
|
inline |
Build a resource:<name> Compare key.
- 参数
-
name Non-empty resource name without a domain prefix.
在文件 ConditionKeys.h 第 59 行定义.
引用了 key, kResourcePrefix , 以及 name.
被这些函数引用 eve::dialogue::DialogueStateContext::resource() , 以及 resourceExists().
◆ stateEquals()
Compare that a state key equals an expected value.
- 参数
-
name State name without prefix. expected Expected scalar or structured value.
在文件 ConditionKeys.h 第 123 行定义.
引用了 eve::condition::Condition::compare(), Equal, name , 以及 stateKey().
◆ stateKey()
|
inline |
Build a state:<name> Compare key.
- 参数
-
name Non-empty state name without a domain prefix.
在文件 ConditionKeys.h 第 69 行定义.
引用了 key, kStatePrefix , 以及 name.
被这些函数引用 eve::dialogue::DialogueStateContext::state() , 以及 stateEquals().
◆ stripPrefix()
|
inline |
Strip a known domain prefix from a key.
- 返回
- The remainder when
keystarts withprefix; otherwise nullopt.
在文件 ConditionKeys.h 第 89 行定义.
引用了 key.
被这些函数引用 eve::card::CardPlayConditionContext::value(), eve::dialogue::StateEvaluationContext::value(), eve::emergence::FactStore::value() , 以及 eve::rpg::SkillConditionContext::value().
◆ tagKey()
|
inline |
Build a tag:<name> Compare key.
- 参数
-
tag Non-empty tag name without a domain prefix.
在文件 ConditionKeys.h 第 39 行定义.
引用了 key, kTagPrefix , 以及 tag.
被这些函数引用 eve::dialogue::DialogueStateContext::hasTag() , 以及 tagPresent().
◆ tagPresent()
|
inline |
Compare that a tag key is present (tag:<name> == true).
- 参数
-
tag Tag name without prefix.
在文件 ConditionKeys.h 第 98 行定义.
引用了 eve::condition::Condition::compare(), Equal, tag , 以及 tagKey().
变量说明
◆ kAttrPrefix
|
inlineconstexpr |
Prefix for attribute values (attr:<name>).
在文件 ConditionKeys.h 第 23 行定义.
被这些函数引用 attrKey(), eve::card::CardPlayConditionContext::value(), eve::dialogue::StateEvaluationContext::value(), eve::emergence::FactStore::value() , 以及 eve::rpg::SkillConditionContext::value().
◆ kAuthorityAllowPolicy
|
inlineconstexpr |
PolicyCall name for read-only authority checks.
在文件 ConditionKeys.h 第 33 行定义.
被这些函数引用 authorityAllow() , 以及 resolveAuthorityAllow().
◆ kAuthorityPrefix
|
inlineconstexpr |
Prefix for authority scopes used as watch/dependency keys.
在文件 ConditionKeys.h 第 29 行定义.
被这些函数引用 authorityKey().
◆ kPolicyPrefix
|
inlineconstexpr |
Prefix for policy watch keys (policy:<name>).
在文件 ConditionKeys.h 第 31 行定义.
◆ kResourcePrefix
|
inlineconstexpr |
Prefix for resource values (resource:<name>).
在文件 ConditionKeys.h 第 25 行定义.
被这些函数引用 resourceKey(), eve::card::CardPlayConditionContext::value(), eve::dialogue::StateEvaluationContext::value(), eve::emergence::FactStore::value() , 以及 eve::rpg::SkillConditionContext::value().
◆ kStatePrefix
|
inlineconstexpr |
Prefix for state values (state:<name>).
在文件 ConditionKeys.h 第 27 行定义.
被这些函数引用 stateKey(), eve::card::CardPlayConditionContext::value(), eve::dialogue::StateEvaluationContext::value(), eve::emergence::FactStore::value() , 以及 eve::rpg::SkillConditionContext::value().
◆ kTagPrefix
|
inlineconstexpr |
Prefix for tag membership booleans (tag:<name>).
在文件 ConditionKeys.h 第 21 行定义.
被这些函数引用 tagKey(), eve::card::CardPlayConditionContext::value(), eve::dialogue::StateEvaluationContext::value(), eve::emergence::FactStore::value() , 以及 eve::rpg::SkillConditionContext::value().