OpenTTD Source 20250506-master-geca826b0a4
|
Generate TileIndices around a center tile or tile area, with increasing distance. More...
#include <tilearea_type.h>
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 |
std::default_sentinel_t | end () const |
Private Attributes | |
SpiralTileIterator | start |
Generate TileIndices around a center tile or tile area, with increasing distance.
Definition at line 316 of file tilearea_type.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 339 of file tilearea_type.h.
|
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 365 of file tilearea_type.h.
|
inline |
Definition at line 367 of file tilearea_type.h.
|
inline |
Definition at line 368 of file tilearea_type.h.
|
private |
Definition at line 371 of file tilearea_type.h.