载入中...
搜索中...
未找到
HitFeel.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
6#include "combat/Damage.h"
7#include "common/Result.h"
8#include "common/SubjectRef.h"
9#include "common/Time.h"
10
11#include <cstdint>
12#include <map>
13#include <string>
14#include <vector>
15
16namespace eve::combat {
17
30
38
41
48
52 std::vector<HitFeelEvent> events;
53};
54
62public:
64 [[nodiscard]] Result<void> apply(HitFeelRequest request);
66 [[nodiscard]] Result<void> applyFromOutcome(const DamageOutcome& outcome);
68 [[nodiscard]] Result<HitFeelAdvance> advance(const SimulationStep& step);
70 [[nodiscard]] HitFeelState state(SubjectRef subject) const;
72 [[nodiscard]] bool isFrozen(SubjectRef subject) const noexcept;
74 [[nodiscard]] bool isStunned(SubjectRef subject) const noexcept;
76 [[nodiscard]] std::size_t activeCount() const noexcept { return states_.size(); }
77
78private:
79 std::map<std::string, HitFeelState, std::less<>> states_;
80 SimulationTick lastTick_ = SimulationTick::zero();
81};
82
83} // namespace eve::combat
int subject
Definition AnimSmr.cpp:163
Deterministic damage, poise, hit-reaction and knockback resolution.
#define EVENGINE_API_BACKENDS
Definition Export.h:108
const GltfImportRequest & request
Move-only, checked operation results for the common layer.
Stable reference to a runtime gameplay subject.
Common time values and an injectable deterministic simulation clock.
float step
Definition TreeMesh.cpp:314
Signed, fixed-resolution simulation duration in nanoseconds.
Definition Time.h:43
static constexpr Duration zero() noexcept
Return zero duration.
Definition Time.h:60
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
Owner-thread hitstop/hitstun coordinator.
Definition HitFeel.h:61
std::size_t activeCount() const noexcept
Number of subjects with any remaining feel timer.
Definition HitFeel.h:76
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
HitReaction
Typed reaction selected after health and poise are resolved.
Definition Damage.h:26
HitFeelEventKind
Observable feel event after apply or advance.
Definition HitFeel.h:40
One deterministic fixed-step emitted by SimulationClock.
Definition Time.h:158
Complete owning audit result of one committed damage transaction.
Definition Damage.h:98
Complete owning result of one feel advance.
Definition HitFeel.h:50
SimulationTick tick
Definition HitFeel.h:51
std::vector< HitFeelEvent > events
Definition HitFeel.h:52
Owning feel event.
Definition HitFeel.h:43
HitFeelEventKind kind
Definition HitFeel.h:45
SimulationTick tick
Definition HitFeel.h:46
Authored freeze/stun durations applied after a damage outcome.
Definition HitFeel.h:19
Result< void > validate() const
Validate subjects and finite non-negative durations.
Definition HitFeel.cpp:13
Per-subject freeze or stun remaining after the last commit.
Definition HitFeel.h:32