|
OpenTTD Source 20261112-master-gbcbec5e63f
|
Generate TileIndices around a center tile or tile area, with increasing distance. More...
#include <tilearea_spiral.h>
Public Types | |
| using | iterator = SpiralTileIterator |
| The tile iterator type for this tile area type. | |
Public Member Functions | |
| SpiralTileSequence (TileIndex center, uint diameter) | |
| Generate TileIndices for a square area around a center tile. | |
| SpiralTileSequence (TileIndex start_north, uint radius, uint w, uint h) | |
| Generate TileIndices for a rectangular area with an optional rectangular hole in the center. | |
| SpiralTileIterator | begin () const |
| Returns an iterator to the start of the tile area. | |
| std::default_sentinel_t | end () const |
| Returns an iterator to the end of the tile area. | |
Private Attributes | |
| SpiralTileIterator | start |
| The starting iterator for thi spiral sequence. | |
Generate TileIndices around a center tile or tile area, with increasing distance.
Definition at line 99 of file tilearea_spiral.h.
The tile iterator type for this tile area type.
Definition at line 101 of file tilearea_spiral.h.
|
inline |
Generate TileIndices for a square area around a center tile.
The size of the square is given by the length of the edge. If the size is even, the south extent will be larger than the north extent.
Example for diameter=4, [ ] is the "center": 1 1 1 1 [0] 1 1 0 0 1 1 0 1 1 1 1 The sequence starts with the "0" tiles, and continues with the shells around it.
| center | Center of the square area. |
| diameter | Edge length of the square. |
Definition at line 124 of file tilearea_spiral.h.
References start.
|
inline |
Generate TileIndices for a rectangular area with an optional rectangular hole in the center.
The TileIndices will be sorted by increasing distance from the center (hole).
Example for radius=2, w=2, h=1, [ ] is "start_north": 1 1 1 1 [0] 1 1 0 0 1 1 0 H 0 1 1 0 H 0 1 1 0 0 1 1 0 1 1 1 1 The sequence starts with the "0" tiles, and continues with the shells around it.
| start_north | Tile directly north from the center hole. |
| radius | Radial distance between outer rectangle and center hole. |
| w | Width of the inner rectangular hole. |
| h | Height of the inner rectangular hole. |
Definition at line 150 of file tilearea_spiral.h.
References start.
|
inline |
Returns an iterator to the start of the tile area.
Definition at line 156 of file tilearea_spiral.h.
References start.
|
inline |
Returns an iterator to the end of the tile area.
Definition at line 165 of file tilearea_spiral.h.
|
private |
The starting iterator for thi spiral sequence.
Definition at line 171 of file tilearea_spiral.h.
Referenced by begin(), SpiralTileSequence(), and SpiralTileSequence().