载入中...
搜索中...
未找到
TacticsBattle.h
浏览该文件的文档.
1#pragma once
2
7
8#include <cstddef>
9#include <vector>
10
11#include "common/Export.h"
12
13namespace eve::tactics {
14
18 std::vector<Cell> path;
19 int cost = 0;
21};
22
38
50public:
52 [[nodiscard]] static Result<void> addSide(Battle& battle, ecs::EntityHandle side);
53
58 [[nodiscard]] static Result<void> addUnit(Battle& battle, ecs::EntityHandle unit, ecs::EntityHandle side,
59 Cell cell);
60
62 [[nodiscard]] static Result<void> start(Battle& battle, std::string policyId);
63
69 [[nodiscard]] static Result<BattlePhase> advance(Battle& battle, const SimulationStep& step);
70
72 [[nodiscard]] static Result<void> endTurn(Battle& battle, SubjectRef actor);
73
78 [[nodiscard]] static Result<MoveReceipt> moveUnit(Battle& battle, SubjectRef actor, Cell destination);
80 [[nodiscard]] static Result<MoveReceipt> moveUnit(Battle& battle, SubjectRef actor, Cell destination,
81 SimulationTick commandTick);
82
84 [[nodiscard]] static Result<void> faceUnit(Battle& battle, SubjectRef actor, int facing);
86 [[nodiscard]] static Result<void> faceUnit(Battle& battle, SubjectRef actor, int facing,
87 SimulationTick commandTick);
89 [[nodiscard]] static Result<void> previewFace(Battle& battle, SubjectRef actor, int facing);
90
92 [[nodiscard]] static Result<void> waitUnit(Battle& battle, SubjectRef actor);
94 [[nodiscard]] static Result<void> waitUnit(Battle& battle, SubjectRef actor, SimulationTick commandTick);
96 [[nodiscard]] static Result<void> previewWait(Battle& battle, SubjectRef actor);
97
117 [[nodiscard]] static Result<AbilityReceipt> useAbility(Battle& battle, SubjectRef actor, const LogicalId& action,
118 Cell targetCell, SubjectRef targetUnit = {},
119 std::string payload = {});
120
128 [[nodiscard]] static Result<AbilityReceipt> previewAbility(Battle& battle, SubjectRef actor,
129 const LogicalId& action, Cell targetCell,
130 SubjectRef targetUnit = {},
131 std::string_view payload = {});
132
134 [[nodiscard]] static Result<MoveReceipt> previewMove(Battle& battle, SubjectRef actor, Cell destination);
135
137 [[nodiscard]] static Result<void> finish(Battle& battle);
138
140 [[nodiscard]] static Result<std::size_t> openReaction(Battle& battle, std::uint64_t triggerSequence,
141 std::vector<ReactionCandidate> candidates);
143 [[nodiscard]] static Result<ReactionReceipt> acceptReaction(Battle& battle, SubjectRef reactor,
144 const LogicalId& action);
146 [[nodiscard]] static Result<void> declineReaction(Battle& battle);
147
149 [[nodiscard]] static Result<void> addObjective(Battle& battle, ObjectiveSpec objective);
150
152 [[nodiscard]] static Result<void> defeatUnit(Battle& battle, SubjectRef unit);
153
158 [[nodiscard]] static Result<std::uint64_t> roll(Battle& battle, const LogicalId& stream);
159
160private:
161 [[nodiscard]] static Result<std::vector<ecs::EntityHandle>> orderedUnits(Battle& battle);
162};
163
164} // namespace eve::tactics
Value::Object payload
Duration start
#define EVENGINE_API_DOMAINS
Definition Export.h:110
ModuleFacing facing
std::string action
Definition PlayHost.cpp:117
Cell cell
Deterministic fixed-cost tactics path queries.
TacticalUnit * unit
std::string policyId
ecs::EntityHandle side
Deterministic board values and short-root ECS entities for tactics.
float step
Definition TreeMesh.cpp:314
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:411
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
Stateless systems over the tactics short-root ECS family.
Battle short-root and authoritative owner of board and turn state.
One deterministic fixed-step emitted by SimulationClock.
Definition Time.h:158
One declared ability activation and the resource state it left behind.
int remainingActionPoints
Remaining action points after the activation was paid for.
SubjectRef targetUnit
The targeted unit, or an invalid subject when the ability targets a cell only.
Logical board coordinate independent of rendering projection.
Committed tactical movement and remaining resource state.
std::vector< Cell > path
Persistent objective definition using stable side identities.