载入中...
搜索中...
未找到
HitFeel.cpp
浏览该文件的文档.
21 Diagnostic::error(DiagnosticCode::InvalidArgument, "hit-feel durations must be non-negative", "duration"));
78 Diagnostic::error(DiagnosticCode::InvalidArgument, "hit-feel tick must be non-decreasing", "tick"));
112 return Result<HitFeelAdvance>::success(std::move(advance), Status::success(StatusCode::Applied));
117 if (found == states_.end()) return HitFeelState{subject, Duration::zero(), Duration::zero(), false};
Deterministic hitstop and hitstun ownership for 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
constexpr std::int64_t nanoseconds() const noexcept
Return the exact signed nanosecond representation.
Definition Time.h:69
static constexpr Duration fromNanoseconds(std::int64_t nanoseconds) noexcept
Construct an exact duration from nanoseconds.
Definition Time.h:55
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
bool isValid() const noexcept
Return whether this reference is valid and non-nil.
Definition SubjectRef.h:38
HitFeelState state(SubjectRef subject) const
Return an owning snapshot, or empty defaults when the subject has no feel state.
Definition HitFeel.cpp:115
Result< HitFeelAdvance > advance(const SimulationStep &step)
Advance remaining timers with the supplied deterministic step.
Definition HitFeel.cpp:75
bool isFrozen(SubjectRef subject) const noexcept
Whether the subject currently has positive hitstop remaining.
Definition HitFeel.cpp:121
bool isStunned(SubjectRef subject) const noexcept
Whether the subject currently has positive hitstun remaining.
Definition HitFeel.cpp:126
Result< void > apply(HitFeelRequest request)
Apply one validated feel request; overlapping windows take the max remaining.
Definition HitFeel.cpp:25
Result< void > applyFromOutcome(const DamageOutcome &outcome)
Derive a feel request from a damage outcome using fixed reaction tables.
Definition HitFeel.cpp:41
constexpr std::uint64_t value() const noexcept
Returns the underlying value at an explicit protocol boundary.
Definition StrongUint64.h:26
Definition ActionDamageSink.cpp:9
@ Flinch
@ Stagger
@ Knockdown
@ HitstunEnded
@ HitstopEnded
@ InvalidArgument
@ Applied
Complete owning audit result of one committed damage transaction.
Definition Damage.h:98
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