载入中...
搜索中...
未找到
ActionCancelWindowState.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
7#include "common/SubjectRef.h"
8
9#include <cstdint>
10#include <functional>
11#include <map>
12#include <string>
13#include <vector>
14
15namespace eve::action::input {
16
18using CancelSubjectResolver = std::function<Result<SubjectRef>(ecs::EntityHandle)>;
19
28
36public:
40 ~ActionCancelWindowState() override;
41
43 void setEnabled(bool enabled);
45 [[nodiscard]] bool enabled() const;
47 [[nodiscard]] bool supports(ActionStateWindowKind kind) const noexcept override;
49 [[nodiscard]] Result<void> enter(const ActionStateWindowBinding& binding,
50 const ActionTimelineEvent& event,
51 const ActionNotifyContext& context) override;
53 [[nodiscard]] Result<void> exit(const ActionStateWindowBinding& binding,
54 const ActionTimelineEvent& event,
55 const ActionNotifyContext& context) override;
56
58 [[nodiscard]] std::vector<std::string> availableCancels(SubjectRef subject) const;
60 [[nodiscard]] Result<ActionCancelMatch> match(SubjectRef subject, std::string_view input) const;
61 [[nodiscard]] std::size_t activeCount() const noexcept { return active_.size(); }
62
63private:
64 using ActiveKey = std::pair<ActionExecutionId, std::string>;
65 struct ActiveCancel {
68 std::vector<std::string> allows;
69 std::int32_t priority = 0;
70 };
71
72 CancelSubjectResolver resolver_;
73 std::map<ActiveKey, ActiveCancel> active_;
74};
75
76} // namespace eve::action::input
Typed combat/input/collision action-state window contracts.
LogicalId itemId
int subject
Definition AnimSmr.cpp:163
int priority
EvpackChunkInput input
Definition Evpack.cpp:170
#define EVENGINE_API_BACKENDS
Definition Export.h:108
TokenKind kind
eve::action::ActionVfxBinding binding
Stable reference to a runtime gameplay subject.
const VegetationPresetContext & context
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:411
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Strong, domain-neutral reference to a runtime subject.
Definition SubjectRef.h:26
Optional target-domain adapter for paired action state windows.
Authoritative projection of active cancel windows.
std::function< Result< SubjectRef >(ecs::EntityHandle)> CancelSubjectResolver
Resolves an owning stable subject from a generation-qualified ECS handle.
ActionStateWindowKind
Stable semantic kind for one built-in state window.
bool enabled
Context linking a routed event to its action execution.
Owning validated state-window request authored on an action timeline.
Owning event projection returned by the runtime sampler.
Owning cancel match between an input/ability tag and an active window.