|
OpenTTD Source 20260311-master-g511d3794ce
|
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 325 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 348 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 374 of file tilearea_type.h.
|
inline |
Definition at line 376 of file tilearea_type.h.
|
inline |
Definition at line 377 of file tilearea_type.h.
|
private |
Definition at line 380 of file tilearea_type.h.