载入中...
搜索中...
未找到
ActionDamageSink.cpp
浏览该文件的文档.
13RPGActor* resolve(ecs::EntityHandle handle) { return dynamic_cast<RPGActor*>(ecs::try_get(handle)); }
25RPGActionDamageSink::RPGActionDamageSink(RPGDamageResolver resolver) : impl_(std::make_unique<Impl>()) {
29RPGActionDamageSink::~RPGActionDamageSink() { cap::removeListener<action::IActionDamageSink>(this); }
39 if (context.preview || context.scrubbing) return Result<void>::success(Status::success(StatusCode::NoOp));
42 return failure(DiagnosticCode::Unsupported, "RPG Vitals damage does not own poise or knockback");
46 if (!ecs::try_get(targetHandle)) return failure(DiagnosticCode::StaleHandle, "Action target was destroyed");
52 if (!ecs::try_get(*context.source)) return failure(DiagnosticCode::StaleHandle, "Action source was destroyed");
当前资源(hp/mana...)的受伤 / 治疗 / 复活 / 死亡。
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
RPGActionDamageSink(RPGDamageResolver resolver)
Register a provider with an owning callback; an empty callback accepts no targets.
Definition ActionDamageSink.cpp:25
Result< void > apply(const action::ActionDamageBinding &binding, const action::ActionNotifyContext &context) override
Settle one timeline hit against authoritative hp and queue its committed receipt.
Definition ActionDamageSink.cpp:37
bool supports(ecs::EntityHandle target) const override
Query the host mapping and current ECS generation without mutation.
Definition ActionDamageSink.cpp:31
std::vector< RPGActionDamageReceipt > takeReceipts()
Transfer and clear all owning receipts in commit order; consume once per host step.
Definition ActionDamageSink.cpp:82
~RPGActionDamageSink() override
Unregister before releasing transient receipts and the resolver.
Definition ActionDamageSink.cpp:29
Settles damage/healing against one RPG actor's Vitals and AttributeSet.
Definition SettlementAdapter.h:48
static double getCurrent(RPGActor *actor, const std::string &resource)
当前值(无 vitals/资源时 0)。
Definition VitalsSystem.cpp:28
Deterministically ordered, composable settlement pipeline.
Definition Settlement.h:542
std::function< std::optional< RPGDamageTarget >(ecs::EntityHandle)> RPGDamageResolver
Resolve a live action entity to an RPG actor and stable reward identity. @ownership Callback captures...
Definition ActionDamageSink.h:29
@ NotFound
@ Unsupported
@ StaleHandle
@ NoOp
@ Applied
Definition Container.h:602
RPG vitals and attribute policy adapter for the common settlement pipeline.
Domain-neutral, deterministic settlement pipeline.
Owning validated damage request authored on an action timeline.
Definition ActionDamageBlock.h:29
Context linking a routed event to its action execution.
Definition ActionNotifyRegistry.h:41
settlement::SettlementPipeline pipeline
Definition ActionDamageSink.cpp:21
std::vector< RPGActionDamageReceipt > receipts
Definition ActionDamageSink.cpp:22
RPGDamageResolver resolver
Definition ActionDamageSink.cpp:20
Domain-neutral input to one settlement operation.
Definition Settlement.h:107