载入中...
搜索中...
未找到
ActionWindowState.cpp
浏览该文件的文档.
14CombatActionWindowState::~CombatActionWindowState() { cap::removeListener<action::IActionStateWindowSink>(this); }
30void CombatActionWindowState::setMeleeHitRuntime(MeleeHitRuntime& melee) noexcept { melee_ = &melee; }
35 return kind == action::ActionStateWindowKind::Hitbox || kind == action::ActionStateWindowKind::Invulnerability;
42 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Unsupported, "combat does not own this state-window kind", "kind"));
43 if (!resolver_) return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "window subject resolver is unavailable", "resolver"));
47 return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "state-window target index is unavailable", "targetIndex"));
52 if (!handle) return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "state window has no source or target", "subject"));
56 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "state-window subject is nil", "subject"));
65 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Conflict, "state-window key is already active with different data", "itemId"));
79 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Unsupported, "combat does not own this state-window kind", "kind"));
84 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Conflict, "state-window exit kind does not match active key", "kind"));
99 if (window.subject == subject && window.binding.kind == action::ActionStateWindowKind::Invulnerability)
Combat-owned active hitbox and invulnerability projections.
Deterministic bone-agnostic melee hitbox/hurtbox sweep.
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 clearMeleeHitRuntime() noexcept
Clear the borrowed melee geometry owner.
Definition ActionWindowState.cpp:32
bool supports(action::ActionStateWindowKind kind) const noexcept override
Whether this sink owns the supplied semantic window kind.
Definition ActionWindowState.cpp:34
void setEnabled(bool enabled)
Opt this owner into or out of Action state-window dispatch.
Definition ActionWindowState.cpp:22
Result< void > enter(const action::ActionStateWindowBinding &binding, const action::ActionTimelineEvent &event, const action::ActionNotifyContext &context) override
Enter one validated window or idempotently observe the same active key.
Definition ActionWindowState.cpp:38
void setMeleeHitRuntime(MeleeHitRuntime &melee) noexcept
Borrow melee geometry so hitbox windows arm and disarm automatically. @lifetime The melee runtime mus...
Definition ActionWindowState.cpp:30
Result< void > exit(const action::ActionStateWindowBinding &binding, const action::ActionTimelineEvent &event, const action::ActionNotifyContext &context) override
Exit one previously entered window by execution and item identity.
Definition ActionWindowState.cpp:75
CombatActionWindowState(ActionWindowSubjectResolver resolver)
Construct with a synchronous resolver copied into the state owner.
Definition ActionWindowState.cpp:11
bool enabled() const
Return whether this exact owner is registered.
Definition ActionWindowState.cpp:16
bool isInvulnerable(SubjectRef subject) const noexcept
Return whether at least one active Montage window protects this stable subject.
Definition ActionWindowState.cpp:96
std::vector< std::string > activeHitboxes(SubjectRef subject) const
Return owning hitbox identifiers active for a stable subject in key order.
Definition ActionWindowState.cpp:105
Owner-thread authority for hurtboxes, hitbox catalogs and sweep hits.
Definition MeleeHit.h:132
Result< void > armHitbox(SubjectRef subject, std::string_view hitboxId, action::ActionExecutionId execution)
Arm one hitbox while a Montage window owns it.
Definition MeleeHit.cpp:214
Result< void > disarmHitbox(SubjectRef subject, std::string_view hitboxId, action::ActionExecutionId execution)
Disarm one hitbox window and forget its per-target hit memory.
Definition MeleeHit.cpp:242
ActionStateWindowKind
Stable semantic kind for one built-in state window.
Definition ActionStateWindowBlock.h:16
@ Invulnerability
Definition ActionDamageSink.cpp:9
std::function< Result< SubjectRef >(ecs::EntityHandle)> ActionWindowSubjectResolver
Resolves an owning stable subject from a generation-qualified ECS handle.
Definition ActionWindowState.h:24
@ InvalidArgument
@ NotFound
@ Unsupported
@ Conflict
@ NoOp
@ Applied
Definition Container.h:602
Context linking a routed event to its action execution.
Definition ActionNotifyRegistry.h:34
Owning validated state-window request authored on an action timeline.
Definition ActionStateWindowBlock.h:19
Owning event projection returned by the runtime sampler.
Definition ActionTimeline.h:146