载入中...
搜索中...
未找到
ActionDamageSink.cpp
浏览该文件的文档.
15CombatActionDamageSink::~CombatActionDamageSink() { cap::removeListener<action::IActionDamageSink>(this); }
43 if (!resolver_) return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "combat-state resolver is unavailable", "resolver"));
45 return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "damage target index is unavailable", "targetIndex"));
47 if (!target) return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "damage target has no combat state", "target"));
CombatState adapter for timeline damage blocks.
Combat-owned active hitbox and invulnerability projections.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
void clearWindowState() noexcept
Clear the borrowed active-window observer.
Definition ActionDamageSink.cpp:35
Result< void > apply(const action::ActionDamageBinding &binding, const action::ActionNotifyContext &context) override
Atomically apply one validated damage request.
Definition ActionDamageSink.cpp:41
bool supports(ecs::EntityHandle target) const override
Whether this sink can resolve the supplied target handle now.
Definition ActionDamageSink.cpp:37
std::optional< DamageOutcome > lastOutcome() const
Return an owning copy of the latest committed damage outcome.
Definition ActionDamageSink.cpp:72
void setWindowState(const CombatActionWindowState &state) noexcept
Borrow active combat windows so invulnerability can reject damage. @lifetime The state owner must out...
Definition ActionDamageSink.cpp:31
CombatActionDamageSink(ActionCombatStateResolver resolver)
Construct with a synchronous resolver copied into the adapter.
Definition ActionDamageSink.cpp:12
bool enabled() const
Return whether this exact adapter is currently registered.
Definition ActionDamageSink.cpp:17
void setEnabled(bool enabled)
Opt this adapter into or out of Action damage dispatch.
Definition ActionDamageSink.cpp:23
Authoritative combat projection of active Montage hitbox and invulnerability windows.
Definition ActionWindowState.h:33
bool isInvulnerable(SubjectRef subject) const noexcept
Return whether at least one active Montage window protects this stable subject.
Definition ActionWindowState.cpp:96
Result< DamageOutcome > apply(CombatState &target, const DamageRequest &request) const
Resolve and atomically commit one damage request.
Definition Damage.cpp:200
Definition ActionDamageSink.cpp:9
std::function< OptionalRef< CombatState >(ecs::EntityHandle)> ActionCombatStateResolver
Resolves a borrowed mutable CombatState for one live ECS handle.
Definition ActionDamageSink.h:25
@ NotFound
@ NoOp
@ Applied
Definition Container.h:602
Owning validated damage request authored on an action timeline.
Definition ActionDamageBlock.h:25
Context linking a routed event to its action execution.
Definition ActionNotifyRegistry.h:34