载入中...
搜索中...
未找到
Settlement.cpp
浏览该文件的文档.
16bool SettlementContext::has(const std::string &key) const { return values.find(key) != values.end(); }
47 eve::Result<void> validate(settlement::SettlementContext&) override { return eve::Result<void>::success(); }
60 eve::Result<settlement::PreparedApply> prepareApply(const settlement::SettlementContext&) override {
100bool SettlementPipeline::unregisterStage(const std::string &pipeline, const std::string &stage) {
141void SettlementPipeline::clearPipeline(const std::string &pipeline) { pipelines().erase(pipeline); }
void ignore(std::string_view reason={}) const noexcept
Explicitly discard this result after documenting the reason.
Definition Result.h:537
static SubjectRef fromPersistentId(PersistentId id) noexcept
Wrap a persistent identity without changing its bytes.
Definition SubjectRef.h:32
static bool unregisterStage(const std::string &pipeline, const std::string &stage)
Unregisters stage.
Definition Settlement.cpp:100
static void registerStage(const std::string &pipeline, const std::string &stage, int priority, Stage fn)
同名 stage 已存在则整体覆盖(fn/priority),并重置为 enabled。
Definition Settlement.cpp:83
static void run(const std::string &pipeline, SettlementContext &ctx)
按 priority 升序依次执行 pipeline 内已启用的阶段;ctx.cancelled 时提前终止。
Definition Settlement.cpp:143
static bool hasStage(const std::string &pipeline, const std::string &stage)
True when stage.
Definition Settlement.cpp:130
static bool setStagePriority(const std::string &pipeline, const std::string &stage, int priority)
Sets the stage priority.
Definition Settlement.cpp:120
static bool setStageEnabled(const std::string &pipeline, const std::string &stage, bool enabled)
Sets the stage enabled.
Definition Settlement.cpp:110
std::function< void(SettlementContext &)> Stage
Definition Settlement.h:65
Mutable calculation frame visible to policy and custom stage code.
Definition Settlement.h:338
Deterministically ordered, composable settlement pipeline.
Definition Settlement.h:542
eve::Result< void > addStage(StageKind kind, std::string name, int priority, StageFunction function)
Add one named custom stage; duplicate names are rejected.
Definition Settlement.cpp:649
eve::Result< SettlementResult > settle(const SettlementRequest &request, ISettlementPolicy &policy, game_event::GameEventLog *events=nullptr) const
Execute one settlement transaction against a domain policy.
Definition Settlement.cpp:744
@ SourceModifiers
StrongUuid< detail::PersistentIdTag > PersistentId
Stable instance identity for persistence, networking and process boundaries.
Definition Identity.h:254
Domain-neutral, deterministic settlement pipeline.
std::unordered_map< std::string, double > values
Definition Settlement.h:41
double get(const std::string &key, double fallback=0.0) const
Returns the value.
Definition Settlement.cpp:9
Domain-neutral input to one settlement operation.
Definition Settlement.h:107