35#ifndef DOXYGEN_SHOULD_SKIP_THIS
133 : m_tileSize(tileSize)
168 : m_tileSize(tileSize)
208 : m_tileSize(tileSize)
209 , m_sideLength(sideLength)
223 : m_tileSize(computeRegularSize(axis, radius))
224 , m_sideLength(radius)
259#ifndef DOXYGEN_SHOULD_SKIP_THIS
264 static constexpr bool value =
true;
The properties of cells.
Definition: Cells.h:63
virtual std::vector< Vector2i > computeNeighbors(Vector2i coords, Vector2i layerSize, Flags< CellNeighborQuery > flags=gf::None) const =0
Compute the neighbors of a cell.
virtual Polyline computePolyline(Vector2i coords) const =0
Compute the polyline representing a cell.
virtual RectI computeVisibleArea(const RectF &local) const noexcept=0
Compute the visible area in terms of coordinates.
virtual ~Cells()
Virtual destructor.
virtual RectF computeBounds(Vector2i layerSize) const noexcept=0
Compute the local bounds of the cells.
virtual RectF computeCellBounds(Vector2i coords) const noexcept=0
Compute the cell bounds.
virtual Vector2i computeCoordinates(Vector2f position) const noexcept=0
Compute the coordinates of a cell.
Bitfield relying on an enumeration.
Definition: Flags.h:48
Hexagonal cells.
Definition: Cells.h:197
std::vector< Vector2i > computeNeighbors(Vector2i coords, Vector2i layerSize, Flags< CellNeighborQuery > flags=gf::None) const override
Compute the neighbors of a cell.
RectF computeCellBounds(Vector2i coords) const noexcept override
Compute the cell bounds.
Polyline computePolyline(Vector2i coords) const override
Compute the polyline representing a cell.
RectF computeBounds(Vector2i layerSize) const noexcept override
Compute the local bounds of the cells.
static Vector2f computeRegularSize(CellAxis axis, float radius)
Get the size of a regular hexagon.
HexagonalCells(float radius, CellAxis axis, CellIndex index)
Make hexagonal cells of the specified size.
Definition: Cells.h:222
RectI computeVisibleArea(const RectF &local) const noexcept override
Compute the visible area in terms of coordinates.
HexagonalCells(Vector2f tileSize, float sideLength, CellAxis axis, CellIndex index)
Make hexagonal cells of the specified size.
Definition: Cells.h:207
Vector2i computeCoordinates(Vector2f position) const noexcept override
Compute the coordinates of a cell.
Orthogonal cells.
Definition: Cells.h:125
Polyline computePolyline(Vector2i coords) const override
Compute the polyline representing a cell.
std::vector< Vector2i > computeNeighbors(Vector2i coords, Vector2i layerSize, Flags< CellNeighborQuery > flags=gf::None) const override
Compute the neighbors of a cell.
Vector2i computeCoordinates(Vector2f position) const noexcept override
Compute the coordinates of a cell.
RectF computeBounds(Vector2i layerSize) const noexcept override
Compute the local bounds of the cells.
RectI computeVisibleArea(const RectF &local) const noexcept override
Compute the visible area in terms of coordinates.
RectF computeCellBounds(Vector2i coords) const noexcept override
Compute the cell bounds.
OrthogonalCells(Vector2f tileSize)
Make orthogonal cells of the specified size.
Definition: Cells.h:132
A polyline.
Definition: Polyline.h:47
Staggered cells.
Definition: Cells.h:158
RectI computeVisibleArea(const RectF &local) const noexcept override
Compute the visible area in terms of coordinates.
std::vector< Vector2i > computeNeighbors(Vector2i coords, Vector2i layerSize, Flags< CellNeighborQuery > flags=gf::None) const override
Compute the neighbors of a cell.
StaggeredCells(Vector2f tileSize, CellAxis axis, CellIndex index)
Make staggered cells of the specified size.
Definition: Cells.h:167
RectF computeBounds(Vector2i layerSize) const noexcept override
Compute the local bounds of the cells.
RectF computeCellBounds(Vector2i coords) const noexcept override
Compute the cell bounds.
Vector2i computeCoordinates(Vector2f position) const noexcept override
Compute the coordinates of a cell.
Polyline computePolyline(Vector2i coords) const override
Compute the polyline representing a cell.
CellAxis
Cell axis for staggered or hexagonal maps.
Definition: CellTypes.h:48
CellIndex
Cell index for staggered or hexagonal maps.
Definition: CellTypes.h:37
CellNeighborQuery
Specification of the query of neighborhood.
Definition: Cells.h:45
@ Valid
The neighbors must be valid cells.
@ Diagonal
The neighbors may be in diagonal.
constexpr NoneType None
Constant to represent "none".
Definition: Types.h:45
The namespace for gf classes.