载入中...
搜索中...
未找到
eve::settlement::SettlementRuleSet类 参考

Validated immutable-style rule collection installable into pipelines. 更多...

#include <SettlementRules.h>

Public 成员函数

eve::Result< void > configure (std::vector< SettlementRule > rules)
 Atomically replace all rules after validating ids, operands and phases.
 
eve::Result< void > configureJson (std::string_view json)
 Atomically decode and replace a strict versioned JSON rule document.
 
eve::Result< void > install (SettlementPipeline &pipeline) const
 Install a stable snapshot as custom stages on a pipeline.
 
std::size_t size () const noexcept
 Return the number of validated rules in this collection.
 
eve::Result< std::string > canonicalJson () const
 Serialize validated rules in their semantic execution order.
 
eve::Result< eve::ContentId > digest (const eve::SnapshotHashProvider &hashProvider) const
 Hash the canonical validated rule-set representation.
 

静态 Public 成员函数

static constexpr std::uint32_t schemaVersion () noexcept
 Stable schema version used by canonical rule-set identity.
 
static eve::Result< SettlementRuleSet > fromJson (std::string_view json)
 Decode and compile a strict versioned JSON rule document without mutating an existing rule set.
 

详细描述

Validated immutable-style rule collection installable into pipelines.

Configuration is transactional: a failed replacement leaves the previous rules unchanged. Installing copies the current rules into pipeline-owned stage callbacks, so the rule set may be destroyed immediately afterwards. The collection is simulation-thread confined; installed callbacks are synchronous and do not retain request or policy references.

在文件 SettlementRules.h 第 77 行定义.

成员函数说明

◆ canonicalJson()

eve::Result< std::string > eve::settlement::SettlementRuleSet::canonicalJson ( ) const

Serialize validated rules in their semantic execution order.

返回
Versioned canonical JSON, or a structured serialization failure. @cost O(n log n) in rule count due to semantic ordering and filter normalization.

在文件 SettlementRuleIdentity.cpp 第 54 行定义.

引用了 left, right , 以及 schemaVersion().

被这些函数引用 digest().

◆ configure()

◆ configureJson()

eve::Result< void > eve::settlement::SettlementRuleSet::configureJson ( std::string_view  json)

Atomically decode and replace a strict versioned JSON rule document.

参数
jsonCanonical settlement.rules document; unknown fields and versions are rejected.
返回
Applied, or a located parse/schema/rule-validation diagnostic while preserving old rules. @cost Linear JSON decode plus condition compilation for every rule.

在文件 SettlementRuleJson.cpp 第 173 行定义.

引用了 configure(), eve::Result< T >::failure(), eve::Value::fromJson(), index, eve::InvalidArgument, root, schemaVersion(), eve::TypeMismatch , 以及 eve::UnknownVersion.

被这些函数引用 fromJson().

◆ digest()

eve::Result< eve::ContentId > eve::settlement::SettlementRuleSet::digest ( const eve::SnapshotHashProvider &  hashProvider) const

Hash the canonical validated rule-set representation.

参数
hashProviderExplicit provider shared with snapshot and settlement result hashing.
返回
Stable content identity, or a structured serialization/provider failure. @cost Canonical serialization plus the injected provider's hashing cost.

在文件 SettlementRuleIdentity.cpp 第 78 行定义.

引用了 canonicalJson(), eve::Diagnostic::error(), eve::Result< T >::failure() , 以及 eve::PreconditionViolation.

◆ fromJson()

eve::Result< SettlementRuleSet > eve::settlement::SettlementRuleSet::fromJson ( std::string_view  json)
static

Decode and compile a strict versioned JSON rule document without mutating an existing rule set.

参数
jsonCanonical settlement.rules document shared by runtime and editor/tool validation.
返回
A validated owning rule set, or the same located diagnostic used by configureJson(). @cost Linear JSON decode plus condition compilation for every rule.

在文件 SettlementRuleJson.cpp 第 165 行定义.

引用了 eve::Applied, configureJson(), eve::Result< T >::failure(), eve::Status::success() , 以及 eve::Result< T >::success().

被这些函数引用 eve::editor::EditorValidationService::EditorValidationService().

◆ install()

eve::Result< void > eve::settlement::SettlementRuleSet::install ( SettlementPipeline &  pipeline) const

Install a stable snapshot as custom stages on a pipeline.

参数
pipelinePipeline mutated on the caller's simulation thread.
返回
Applied, or a duplicate-stage/configuration diagnostic. @cost Linear in rule count and copies the validated configuration once.

在文件 SettlementRules.cpp 第 900 行定义.

引用了 eve::settlement::SettlementPipeline::addStage(), eve::Applied, condition, context, digest, index, left, name, priority, right, eve::Status::success() , 以及 eve::Result< T >::success().

被这些函数引用 eve::card::CardEffectExecutor::configureSettlementRules(), eve::combat::DamageRuntime::configureSettlementRules(), eve::rpg::Battle::configureSettlementRules() , 以及 eve::tactics::TacticsSettlementRuntime::configureSettlementRules().

◆ schemaVersion()

static constexpr std::uint32_t eve::settlement::SettlementRuleSet::schemaVersion ( )
inlinestaticconstexprnoexcept

Stable schema version used by canonical rule-set identity.

在文件 SettlementRules.h 第 80 行定义.

被这些函数引用 canonicalJson() , 以及 configureJson().

◆ size()

std::size_t eve::settlement::SettlementRuleSet::size ( ) const
inlinenoexcept

Return the number of validated rules in this collection.

在文件 SettlementRules.h 第 110 行定义.


该类的文档由以下文件生成: