载入中...
搜索中...
未找到
HexVisibility.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
7#include "common/Result.h"
8#include "hexmap/HexSearch.h"
9
10#include <cstdint>
11#include <vector>
12
13namespace eve::hexmap {
14
33public:
35 HexVisibility() = default;
36
43 void reset(std::int32_t cellCount);
44
46 [[nodiscard]] std::int32_t cellCount() const noexcept { return static_cast<std::int32_t>(counts_.size()); }
47
49 [[nodiscard]] bool isVisible(std::int32_t cellIndex) const noexcept;
51 [[nodiscard]] std::int32_t visibility(std::int32_t cellIndex) const noexcept;
53 [[nodiscard]] std::int32_t visibleCellCount() const noexcept;
54
65 [[nodiscard]] Result<void> increase(HexMap& map, HexSearchContext& scratch, HexCoordinates from,
66 std::int32_t range);
67
81 [[nodiscard]] Result<void> decrease(HexMap& map, HexSearchContext& scratch, HexCoordinates from,
82 std::int32_t range);
83
95 void clear(HexMap& map) noexcept;
96
97private:
98 std::vector<std::int32_t> counts_;
100 std::vector<std::int32_t> touched_;
101};
102
103} // namespace eve::hexmap
std::string from
#define EVENGINE_API_WORLD
Definition Export.h:109
Cell-graph search used by pathfinding and visibility.
Range range
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
An editable, chunked, pointy-top hex map.
Definition HexMap.h:72
Reusable search scratch: one record per cell plus a priority bucket queue.
Definition HexSearch.h:68
Fog-of-war bookkeeping: how many viewers currently see each cell.
HexVisibility()=default
Hex visibility.
std::int32_t cellCount() const noexcept
Number of tracked cells.
Axial coordinates of one hex cell.