载入中...
搜索中...
未找到
WeaponEffects.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
10#include "common/Result.h"
11#include "common/SubjectRef.h"
12#include "common/Time.h"
14
15#include <cstdint>
16#include <string>
17#include <vector>
18
19namespace eve::weapon {
20
22enum class WeaponEffectKind : std::uint8_t { Heat, Jam, Recoil };
23
26 double heat = 0.0;
27 double maxHeat = 100.0;
28 bool jammed = false;
29 double recoil = 0.0;
30 std::uint32_t blockedShots = 0;
31};
32
35 std::string id;
36 std::string source;
37 double duration = 0.0;
38 double period = 0.0;
39 double magnitude = 0.0;
42 std::vector<std::string> tags;
43};
44
51
57
70
73public:
80 [[nodiscard]] eve::Result<WeaponEffectUpdate> advance(const eve::SimulationStep& step);
82 [[nodiscard]] WeaponEffectSnapshot snapshot() const;
84 [[nodiscard]] eve::Result<void> restore(const WeaponEffectSnapshot& snapshot);
88 [[nodiscard]] WeaponEffectTarget& target() noexcept { return target_; }
90 [[nodiscard]] const WeaponEffectTarget& target() const noexcept { return target_; }
91
92private:
93 effects::EffectContainer container_;
94 WeaponEffectExecutor executor_;
95 WeaponEffectTarget target_;
96};
97
98} // namespace eve::weapon
LogicalId target
int subject
Definition AnimSmr.cpp:163
Owning effect storage and lifecycle-only executor.
#define EVENGINE_API_WORLD
Definition Export.h:109
std::unique_ptr< ParticleEffect > effect
PrimitiveHandle handle
Move-only, checked operation results for the common layer.
Stable reference to a runtime gameplay subject.
LogicalId definition
Common time values and an injectable deterministic simulation clock.
float step
Definition TreeMesh.cpp:314
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
Owns active effect instances and their deterministic lifecycle events.
Weapon adapter with a single common lifecycle owner.
const WeaponEffectTarget & target() const noexcept
Read the weapon target state.
WeaponEffectTarget & target() noexcept
Access the mutable weapon target state.
Weapon executor applying heat, jam and recoil rules.
eve::Result< void > applyImmediate(WeaponEffectTarget &target, const effects::EffectInstance &effect) const
Apply an immediate jam/recoil strategy to a staged target.
eve::Result< void > validate(const WeaponEffectTarget &target) const
Validate heat and recoil invariants.
eve::Result< WeaponEffectUpdate > settle(WeaponEffectTarget &target, effects::EffectUpdateSummary lifecycle) const
Settle common periodic triggers through weapon policy.
载具模块入口(eve.Vehicle):定义注册 / 实体工厂 / RTS 命令 / 帧调度。 设计文档:docs/dev/通用载具系统设计.md
WeaponEffectKind
Weapon-specific effect strategy.
One deterministic fixed-step emitted by SimulationClock.
Definition Time.h:158
Generation-qualified local reference to a canonical effect instance.
One owned runtime effect fact.
Independent policy dimensions used when applying an effect definition.
Definition EffectTypes.h:53
Summary returned by the lifecycle executor after one simulation step.
Typed weapon definition projected into the common lifecycle.
std::vector< std::string > tags
In-memory weapon effect snapshot.
effects::EffectContainer effects
Mutable weapon state interpreted by the typed executor.
Result of one weapon lifecycle step and domain settlement.
effects::EffectUpdateSummary lifecycle