载入中...
搜索中...
未找到
Interaction.h 文件参考

Board interaction state machine that returns intents instead of mutating. 更多...

#include "common/Result.h"
#include "tactics/TacticsTypes.h"
#include <cstdint>
#include <map>
#include <string>
#include <vector>

浏览源代码.

类

struct  eve::tactics::InteractionIntent
 One player intention, expressed with stable identities only. 更多...
 
struct  eve::tactics::InteractionContext
 Immutable projection of everything the interaction machine is allowed to know. 更多...
 
class  eve::tactics::InteractionSession
 A disposable, non-authoritative interaction session. 更多...
 

命名空间

namespace  eve
 Build metadata (engine git commit, build time, third-party version).
 
namespace  eve::tactics
 

枚举

enum class  eve::tactics::InteractionState : std::uint8_t {
  eve::tactics::Blocked , eve::tactics::AwaitSelection , eve::tactics::UnitSelected , eve::tactics::Targeting ,
  eve::tactics::Resolving , eve::tactics::Ended
}
 Where the interaction machine is, as far as the player is concerned. 更多...
 
enum class  eve::tactics::InteractionIntentKind : std::uint8_t {
  eve::tactics::None , eve::tactics::SelectUnit , eve::tactics::MoveTo , eve::tactics::UseAbilityOn ,
  eve::tactics::Cancel , eve::tactics::Confirm , eve::tactics::EndTurn
}
 What the player asked for. A value, not a mutation. 更多...
 

函数

std::string_view eve::tactics::interactionStateName (InteractionState state) noexcept
 Human-readable stable spelling of an interaction state (protocol text).
 
std::string_view eve::tactics::interactionIntentKindName (InteractionIntentKind kind) noexcept
 Human-readable stable spelling of an intent kind (protocol text).
 

详细描述

Board interaction state machine that returns intents instead of mutating.

The gap this closes: a turn-based UI normally owns its own selection/highlight state on top of the simulation, so the same rule ("may this unit move there?") ends up implemented twice — once for the highlight and once for the commit. Here the state machine reads an immutable, caller-supplied projection of the battle and answers with a value describing what the player asked for. It never touches the battle, so it is headlessly replayable and cannot become a second authority over game state.

This header has no rendering, input or ECS dependency by design: tactics stays render-free, and a UI may run this machine on any thread that owns its own copy.

在文件 Interaction.h 中定义.