载入中...
搜索中...
未找到
Interaction.h
浏览该文件的文档.
63[[nodiscard]] EVENGINE_API_DOMAINS std::string_view interactionStateName(InteractionState state) noexcept;
65[[nodiscard]] EVENGINE_API_DOMAINS std::string_view interactionIntentKindName(InteractionIntentKind kind) noexcept;
168 [[nodiscard]] Result<void> armAbility(const LogicalId& action, std::vector<Cell> targetableCells);
Move-only, checked operation results for the common layer.
Deterministic board values and short-root ECS entities for tactics.
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:411
A disposable, non-authoritative interaction session.
Definition Interaction.h:128
const InteractionContext & context() const noexcept
The context this session was created from.
Definition Interaction.h:145
const LogicalId & armedAction() const noexcept
The ability currently armed, or an invalid id when none is.
Definition Interaction.h:147
Definition Interaction.cpp:13
std::string_view interactionStateName(InteractionState state) noexcept
Human-readable stable spelling of an interaction state (protocol text).
Definition Interaction.cpp:22
@ UseAbilityOn
Declare InteractionIntent::action against cell and optional unit.
@ None
Nothing to do: the click landed somewhere with no meaning in this state.
@ MoveTo
Move the controlled unit onto InteractionIntent::cell.
std::string_view interactionIntentKindName(InteractionIntentKind kind) noexcept
Human-readable stable spelling of an intent kind (protocol text).
Definition Interaction.cpp:34
InteractionState
Where the interaction machine is, as far as the player is concerned.
Definition Interaction.h:29
@ Blocked
Not this controller's turn, or the battle is not accepting input at all.
@ Resolving
The caller has an uncommitted intent and must commit or cancel it.
@ Targeting
An ability is armed; the next click picks its target.
@ UnitSelected
The controlled unit is selected; the next click acts on a cell.
@ AwaitSelection
Nothing selected yet; a click picks a destination or the active unit.
Definition Container.h:602
Logical board coordinate independent of rendering projection.
Definition TacticsTypes.h:30
Immutable projection of everything the interaction machine is allowed to know.
Definition Interaction.h:98
std::map< Cell, SubjectRef > unitsByCell
Unit occupying each cell, for turning a targeted cell into a targeted unit.
Definition Interaction.h:112
SubjectRef controlledUnit
The unit this session drives. An invalid subject means "observe only".
Definition Interaction.h:104
SubjectRef activeUnit
The unit currently allowed to act, or an invalid subject when none is.
Definition Interaction.h:102
Revision revision
The revision the caller observed when it built this context.
Definition Interaction.h:114
std::vector< Cell > reachableCells
Destinations the controlled unit may legally move to.
Definition Interaction.h:108
std::vector< Cell > targetableCells
Cells where an armed ability may legally land.
Definition Interaction.h:110
Cell controlledCell
Cell of the controlled unit, used to recognise a click on the unit itself.
Definition Interaction.h:106
One player intention, expressed with stable identities only.
Definition Interaction.h:74
SubjectRef actor
The unit the intent is about (the controlled unit when one is known).
Definition Interaction.h:77
SubjectRef targetUnit
Unit occupying the target cell, when the intent targets a unit.
Definition Interaction.h:82