载入中...
搜索中...
未找到
Presentation.cpp
浏览该文件的文档.
21PresentationCommand revertible(const BattleEvent& event, const PresentationFrame& frame, SubjectRef subject,
37PresentationCommand durable(const BattleEvent& event, const PresentationFrame& frame, SubjectRef subject,
39 PresentationCommand command = revertible(event, frame, subject, state, PresentationRevertTrigger::Never);
101 PresentationCommand declared = revertible(event, frame, event.subject, UnitVisualState::Attacking,
119 DiagnosticCode::Unsupported, "durable presentation intent cannot be reverted", "presentation.revert"));
Stable, structured diagnostics shared by engine modules.
Presentation intents derived from the battle event stream, with an explicit undo.
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
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
Definition StrongUint64.h:24
Result< PresentationIntent > revert(const PresentationIntent &intent, const PresentationRevert &spec) const
Build the inverse intent that undoes intent.
Definition Presentation.cpp:115
Result< std::vector< PresentationCommand > > project(const BattleEvent &event, const BattleCommand *command, const PresentationFrame &frame) const
Project one authoritative event into presentation commands.
Definition Presentation.cpp:72
Definition Interaction.cpp:13
PresentationRevertTrigger
What makes a presentation intent stop being true.
Definition Presentation.h:62
@ Never
Durable state (defeat, end of round): never taken back.
@ OnNextTurn
Clear when any unit's next turn starts.
@ OnRoundStart
Clear at the next round boundary.
std::string_view presentationRevertTriggerName(PresentationRevertTrigger trigger) noexcept
Human-readable stable spelling of a revert trigger (protocol text).
Definition Presentation.cpp:62
std::string_view unitVisualStateName(UnitVisualState state) noexcept
Human-readable stable spelling of a visual state (protocol text).
Definition Presentation.cpp:47
@ UseAbility
Declare a unit ability activation against a target cell.
@ Unsupported
detail::StrongUint64< detail::SimulationTickTag > SimulationTick
Deterministic simulation time step; it is not wall-clock time.
Definition Time.h:31
One accepted replay command using only persistent identities and values.
Definition TacticsTypes.h:386
SubjectRef targetUnit
The unit this command targeted, when the command targets one.
Definition TacticsTypes.h:401
One deterministic battle lifecycle event owned by Battle.
Definition TacticsTypes.h:312
One intent together with the way to take it back.
Definition Presentation.h:136
What the projector knows about the battle beyond the event itself.
Definition Presentation.h:148
One presentation instruction: what to show, where, and until when.
Definition Presentation.h:88
std::vector< Cell > path
Traversal the consumer may animate; empty when not applicable.
Definition Presentation.h:101
SubjectRef other
The other unit involved (ability target, attacker), when there is one.
Definition Presentation.h:94
std::uint64_t sequence
Battle event sequence this intent was projected from.
Definition Presentation.h:90
The explicit undo contract for one intent.
Definition Presentation.h:122
std::uint64_t sequence
Event sequence the revert belongs to, for correlation.
Definition Presentation.h:127
UnitVisualState restingState
The state to restore when the trigger fires.
Definition Presentation.h:124
constexpr bool isRevertable() const noexcept
Whether a consumer may undo the intent at all.
Definition Presentation.h:130