Read-only EvaluationContext backed by one card instance and definition. 更多...
#include <CardPlay.h>
Public 成员函数 | |
| CardPlayConditionContext (const CardData *card, const CardDefinition &definition, CardPlayConditionQueries queries={}) | |
| Bind a card instance and definition for one evaluation. | |
| std::optional< eve::Value > | value (std::string_view key) const override |
| Query a named scalar or structured value for Compare nodes. | |
| std::optional< bool > | hasTag (std::string_view tag) const override |
| Query tag membership; nullopt means the tag source is unavailable. | |
| std::optional< eve::Value > | attribute (std::string_view key) const override |
| Query an attribute value; nullopt means the attribute is absent. | |
| std::optional< eve::Value > | resource (std::string_view key) const override |
| Query a resource amount or resource marker. | |
| std::optional< eve::Value > | state (std::string_view key) const override |
| Query a state value for StateEquals nodes. | |
| std::optional< bool > | authority (std::string_view scope) const override |
| Query authority without changing grants, leases, or state. | |
| std::optional< decision::ConditionResult > | policy (std::string_view name, const eve::Value &arguments) const override |
| Evaluate a named read-only policy with owned arguments. | |
Public 成员函数 继承自 eve::decision::EvaluationContext | |
| virtual | ~EvaluationContext ()=default |
| Releases EvaluationContext resources. | |
详细描述
Read-only EvaluationContext backed by one card instance and definition.
Both pointers are borrowed only for the synchronous evaluate call. Card attributes expose the definition's cost/attack/health, while resource, authority and policy lookups are supplied by the owning game/profile.
在文件 CardPlay.h 第 47 行定义.
构造及析构函数说明
◆ CardPlayConditionContext()
| eve::card::CardPlayConditionContext::CardPlayConditionContext | ( | const CardData * | card, |
| const CardDefinition & | definition, | ||
| CardPlayConditionQueries | queries = {} |
||
| ) |
Bind a card instance and definition for one evaluation.
- 参数
-
card Borrowed card instance; it must outlive the evaluation call. definition Borrowed definition; it must outlive the call. queries Optional read-only providers for external capabilities.
在文件 CardPlay.cpp 第 27 行定义.
成员函数说明
◆ attribute()
|
overridevirtual |
Query an attribute value; nullopt means the attribute is absent.
Attribute.
实现了 eve::decision::EvaluationContext.
在文件 CardPlay.cpp 第 40 行定义.
引用了 eve::card::CardDefinition::attack, eve::card::CardDefinition::cost, eve::card::CardDefinition::health , 以及 key.
◆ authority()
|
overridevirtual |
Query authority without changing grants, leases, or state.
Authority.
实现了 eve::decision::EvaluationContext.
在文件 CardPlay.cpp 第 57 行定义.
引用了 eve::card::CardPlayConditionQueries::authority , 以及 scope.
◆ hasTag()
|
overridevirtual |
Query tag membership; nullopt means the tag source is unavailable.
True when tag.
实现了 eve::decision::EvaluationContext.
在文件 CardPlay.cpp 第 35 行定义.
引用了 tag , 以及 eve::card::CardDefinition::tags.
◆ policy()
|
overridevirtual |
Evaluate a named read-only policy with owned arguments.
Policy.
实现了 eve::decision::EvaluationContext.
在文件 CardPlay.cpp 第 62 行定义.
◆ resource()
|
overridevirtual |
Query a resource amount or resource marker.
实现了 eve::decision::EvaluationContext.
在文件 CardPlay.cpp 第 48 行定义.
◆ state()
|
overridevirtual |
Query a state value for StateEquals nodes.
State.
实现了 eve::decision::EvaluationContext.
在文件 CardPlay.cpp 第 53 行定义.
引用了 key.
◆ value()
|
overridevirtual |
Query a named scalar or structured value for Compare nodes.
实现了 eve::decision::EvaluationContext.
在文件 CardPlay.cpp 第 31 行定义.
引用了 key.
该类的文档由以下文件生成:
- src/modules/card/CardPlay.h
- src/modules/card/CardPlay.cpp
Public 成员函数 继承自