载入中...
搜索中...
未找到
AttackVfxRuntime.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
13#include "common/Identity.h"
14#include "common/Result.h"
16
17#include <cstdint>
18#include <memory>
19#include <optional>
20#include <string>
21#include <string_view>
22#include <vector>
23
24namespace eve::stylize {
25
28 std::uint32_t slot = 0;
29 std::uint32_t generation = 0;
30
32 friend bool operator==(const AttackVfxHandle&, const AttackVfxHandle&) = default;
33};
34
36enum class AttackVfxStopMode : std::uint8_t {
39 Cancel
40};
41
49 std::optional<LogicalId> skinOverride;
50 std::uint32_t sourceId = 0;
51 std::uint32_t sourceGeneration = 0;
52 std::uint32_t targetId = 0;
53 std::uint32_t targetGeneration = 0;
54 std::string clockName = "absolute";
55};
56
60 bool armed = false;
61 bool active = false;
62 bool completed = false;
63 double localTime = 0.0;
64 std::size_t layerCount = 0;
65};
66
71 std::optional<LogicalId> activeSkinId;
72 double age = 0.0;
73 bool stopping = false;
75 std::vector<AttackVfxPhaseState> phases;
76};
77
99
102 std::vector<AttackVfxHandle> advanced;
103 std::vector<AttackVfxHandle> stopped;
104 std::vector<AttackVfxFrameEvent> events;
105};
106
116public:
121
124
129 [[nodiscard]] Result<void> configurePool(std::uint32_t capacity);
130
132 [[nodiscard]] Result<void> registerRecipe(const AttackVfxRecipe& recipe);
133
135 [[nodiscard]] Result<void> registerSkin(const AttackVfxSkin& skin);
136
138 [[nodiscard]] std::optional<AttackVfxRecipe> findRecipe(const LogicalId& id) const;
139
141 [[nodiscard]] std::optional<AttackVfxSkin> findSkin(const LogicalId& id) const;
142
147 [[nodiscard]] Result<AttackVfxHandle> play(const LogicalId& recipeId, const AttackVfxRequest& request);
148
154 [[nodiscard]] Result<AttackVfxFrame> signal(AttackVfxHandle handle, std::string_view cue);
155
160 [[nodiscard]] Result<AttackVfxFrame> advance(double dtSeconds);
161
164
166 [[nodiscard]] std::optional<AttackVfxInstanceState> inspect(AttackVfxHandle handle) const;
167
169 [[nodiscard]] std::size_t activeCount() const noexcept;
170
172 [[nodiscard]] std::size_t capacity() const noexcept;
173
174private:
175 struct Impl;
176 std::unique_ptr<Impl> impl_;
177};
178
179} // namespace eve::stylize
Data-driven layered attack VFX recipe and element skin (Phase 1 schema).
#define EVENGINE_API_WORLD
Definition Export.h:109
const GltfImportRequest & request
std::uint32_t capacity
Strong identity values shared by persistence, content and logical-name APIs.
PrimitiveHandle handle
Move-only, checked operation results for the common layer.
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
Deterministic pooled runtime for AttackVfxRecipe instances.
AttackVfxRuntime & operator=(const AttackVfxRuntime &)=delete
AttackVfxRuntime(const AttackVfxRuntime &)=delete
AttackVfxLayerRole
Which existing presentation backend a layer binds to.
AttackVfxPhaseKind
Attack presentation phase along the cast → hit → linger timeline.
AttackVfxStopMode
How stop() tears down an instance.
Observable frame events emitted by advance/signal/stop.
Owning result of one atomic orchestration step.
std::vector< AttackVfxHandle > advanced
std::vector< AttackVfxFrameEvent > events
std::vector< AttackVfxHandle > stopped
Generation-qualified reference to one pooled attack VFX instance.
friend bool operator==(const AttackVfxHandle &, const AttackVfxHandle &)=default
Operator ==.
Owning observable state for one live instance.
std::vector< AttackVfxPhaseState > phases
std::optional< LogicalId > activeSkinId
Live observation of one phase inside an instance.
Versioned attack VFX composition recipe.
std::optional< LogicalId > skinOverride
Reusable elemental / style skin applied at play time.