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

Injectable line-of-sight and cover policies over the tactical board. 更多...

#include "common/Result.h"
#include "tactics/TacticsPath.h"
#include "tactics/TacticsTypes.h"
#include <memory>
#include <string_view>
#include <vector>
#include "common/Export.h"

浏览源代码.

类

class  eve::tactics::ILineOfSightPolicy
 Answers "can @p from see @p to" for one board. 更多...
 
class  eve::tactics::ICoverPolicy
 Answers "how much cover does @p target have against @p attacker". 更多...
 
class  eve::tactics::GridLineOfSightPolicy
 The built-in grid policy: a straight-line trace over the board's own topology. 更多...
 
class  eve::tactics::GridCoverPolicy
 The built-in cover policy: blockers adjacent to the target, prioritising the line. 更多...
 

命名空间

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

枚举

enum class  eve::tactics::CoverLevel : std::uint8_t { eve::tactics::None , eve::tactics::Half , eve::tactics::Full }
 How much protection a cell gives against an attacker. 更多...
 

函数

std::string_view eve::tactics::coverLevelName (CoverLevel level) noexcept
 Stable protocol spelling of a cover level.
 
std::shared_ptr< ILineOfSightPolicy > eve::tactics::gridLineOfSightPolicy ()
 The process-wide built-in line-of-sight policy.
 
std::shared_ptr< ICoverPolicy > eve::tactics::gridCoverPolicy ()
 The process-wide built-in cover policy (same ownership remarks as above).
 
Result< std::vector< Cell > > eve::tactics::visibleCellsInRange (const BoardState &board, const ILineOfSightPolicy &policy, Cell origin, int minimum, int maximum, CellRangeMetric metric)
 Cells within a metric range of origin that policy can actually see.
 

变量

constexpr std::string_view eve::tactics::kSightBlockerTag = "sight_blocker"
 Cell tag that makes a cell block line of sight.
 

详细描述

Injectable line-of-sight and cover policies over the tactical board.

The gap this closes: a turn-based tactics game needs "can this unit see that cell" and "how much cover does that cell give", and the reference framework answers both inside its per-ability targeting code. That makes the answer untestable, unreusable and impossible to replace with a different board shape.

Here both questions are interfaces with named capabilities, plus one built-in grid implementation that understands the three board topologies tactics already supports. The interfaces are the seam a different board (a hex map with its own projection, a project's own occlusion rules) plugs into: it registers its own provider instead of the tactics core growing a second geometry.

Blocking is read from the persisted cell tags rather than from a new field: passable already means "may be entered", and a low wall or a smoke cloud blocks sight without blocking movement. Reading a tag keeps sight a separate fact that costs no schema version, and the tag name is a named constant so it is not a magic string.

This header has no rendering or ECS dependency: policies read BoardState values only.

在文件 LineOfSight.h 中定义.