载入中...
搜索中...
未找到
ActionCancelWindowState.cpp
浏览该文件的文档.
26ActionCancelWindowState::ActionCancelWindowState(CancelSubjectResolver resolver) : resolver_(std::move(resolver)) {}
28ActionCancelWindowState::~ActionCancelWindowState() { cap::removeListener<IActionStateWindowSink>(this); }
53 Diagnostic::error(DiagnosticCode::Unsupported, "input adapter does not own this window kind", "kind"));
56 Diagnostic::error(DiagnosticCode::NotFound, "cancel subject resolver is unavailable", "resolver"));
65 Diagnostic::error(DiagnosticCode::NotFound, "cancel target index is unavailable", "targetIndex"));
72 Diagnostic::error(DiagnosticCode::NotFound, "cancel window has no source or target", "subject"));
86 Diagnostic::error(DiagnosticCode::Conflict, "cancel-window key has different active data", "itemId"));
98 Diagnostic::error(DiagnosticCode::Unsupported, "input adapter does not own this window kind", "kind"));
118Result<ActionCancelMatch> ActionCancelWindowState::match(SubjectRef subject, std::string_view input) const {
123 if (std::find(window.allows.begin(), window.allows.end(), input) == window.allows.end()) continue;
Cancel-window projection for action combat.
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
Result< void > exit(const ActionStateWindowBinding &binding, const ActionTimelineEvent &event, const ActionNotifyContext &context) override
Exit.
Definition ActionCancelWindowState.cpp:93
Result< void > enter(const ActionStateWindowBinding &binding, const ActionTimelineEvent &event, const ActionNotifyContext &context) override
Enter.
Definition ActionCancelWindowState.cpp:48
bool supports(ActionStateWindowKind kind) const noexcept override
Supports.
Definition ActionCancelWindowState.cpp:44
std::vector< std::string > availableCancels(SubjectRef subject) const
Return sorted unique allow tags currently active for a subject.
Definition ActionCancelWindowState.cpp:106
ActionCancelWindowState(CancelSubjectResolver resolver)
Construct with a synchronous stable-subject resolver.
Definition ActionCancelWindowState.cpp:26
~ActionCancelWindowState() override
Action cancel window state.
Definition ActionCancelWindowState.cpp:28
Result< ActionCancelMatch > match(SubjectRef subject, std::string_view input) const
Resolve the highest-priority window that allows the semantic input.
Definition ActionCancelWindowState.cpp:118
std::function< Result< SubjectRef >(ecs::EntityHandle)> CancelSubjectResolver
Resolves an owning stable subject from a generation-qualified ECS handle.
Definition ActionCancelWindowState.h:18
ActionStateWindowKind
Stable semantic kind for one built-in state window.
Definition ActionStateWindowBlock.h:16
@ 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
Owning cancel match between an input/ability tag and an active window.
Definition ActionCancelWindowState.h:21
LogicalId itemId
Definition ActionCancelWindowState.h:23