载入中...
搜索中...
未找到
TacticsLineOfSightAdapter.h
浏览该文件的文档.
1#pragma once
2
24#include "common/ECS.h"
25#include "common/Result.h"
26#include "sensing/Targeting.h"
27
28#include "common/Export.h"
29
30namespace eve::tactics {
31
40public:
47 [[nodiscard]] Result<void> bindBattle(ecs::EntityHandle battle);
48
50 [[nodiscard]] Result<void> unbindBattle(ecs::EntityHandle battle);
51
53 [[nodiscard]] ecs::EntityHandle boundBattle() const noexcept { return battle_; }
54
56 [[nodiscard]] bool hasBoundBattle() const noexcept { return bound_; }
57
61 const sensing::TargetLocation& to) const override;
62
63private:
64 ecs::EntityHandle battle_{};
71 bool bound_ = false;
72};
73
75[[nodiscard]] EVENGINE_API_DOMAINS TacticsLineOfSightAdapter& tacticsLineOfSightAdapter();
76
86[[nodiscard]] Result<void> registerTacticsLineOfSightProvider();
87
88} // namespace eve::tactics
std::string from
#define EVENGINE_API_DOMAINS
Definition Export.h:110
HexCoordinates to
Cell the unit walks towards on this segment.
Definition HexUnits.cpp:64
Move-only, checked operation results for the common layer.
Coordinate-safe targeting protocol shared by sensing and gameplay adapters.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Consumer-owned line-of-sight capability.
Definition Targeting.h:431
Answers grid line-of-sight queries from the bound tactics battle.
bool hasBoundBattle() const noexcept
Whether a battle is currently bound.
ecs::EntityHandle boundBattle() const noexcept
The currently bound battle, or an invalid handle when none is bound.
std::variant< WorldPoint, GridPoint > TargetLocation
Either a world point or a grid point, with the tag retained.
Definition Targeting.h:198
Result< void > registerTacticsLineOfSightProvider()
Claim the grid coordinate spaces for the tactics adapter.
TacticsLineOfSightAdapter & tacticsLineOfSightAdapter()
The process-wide adapter instance the capability answers with.