|
OpenTTD Source 20251126-master-g67ded4f980
|
Helper class for SpiralTileSequence. More...
#include <tilearea_type.h>
Public Types | |
| using | value_type = TileIndex |
| using | difference_type = std::ptrdiff_t |
| using | iterator_category = std::forward_iterator_tag |
| using | pointer = void |
| using | reference = void |
Public Member Functions | |
| SpiralTileIterator (TileIndex center, uint diameter) | |
| See SpiralTileSequence constructor for description. | |
| SpiralTileIterator (TileIndex start_north, uint radius, uint w, uint h) | |
| See SpiralTileSequence constructor for description. | |
| bool | operator== (const SpiralTileIterator &rhs) const |
| bool | operator== (const std::default_sentinel_t &) const |
| TileIndex | operator* () const |
| SpiralTileIterator & | operator++ () |
| SpiralTileIterator | operator++ (int) |
Private Member Functions | |
| void | SkipOutsideMap () |
| Advance the internal state until it reaches a valid tile or the end. | |
| void | InitPosition () |
| Initialise "position" after "dir" was changed. | |
| void | Increment () |
| Advance the internal state to the next potential tile. | |
| bool | IsEnd () const |
| Test whether the iterator reached the end. | |
Private Attributes | |
| uint | max_radius |
| std::array< uint, DIAGDIR_END > | extent |
| uint | cur_radius |
| DiagDirection | dir |
| uint | position |
| uint | x |
| uint | y |
Helper class for SpiralTileSequence.
Definition at line 259 of file tilearea_type.h.
| using SpiralTileIterator::difference_type = std::ptrdiff_t |
Definition at line 262 of file tilearea_type.h.
| using SpiralTileIterator::iterator_category = std::forward_iterator_tag |
Definition at line 263 of file tilearea_type.h.
| using SpiralTileIterator::pointer = void |
Definition at line 264 of file tilearea_type.h.
| using SpiralTileIterator::reference = void |
Definition at line 265 of file tilearea_type.h.
Definition at line 261 of file tilearea_type.h.
| SpiralTileIterator::SpiralTileIterator | ( | TileIndex | center, |
| uint | diameter | ||
| ) |
See SpiralTileSequence constructor for description.
Definition at line 302 of file tilearea.cpp.
References DIAGDIR_BEGIN, InitPosition(), INVALID_DIAGDIR, SkipOutsideMap(), TileX(), and TileY().
| SpiralTileIterator::SpiralTileIterator | ( | TileIndex | start_north, |
| uint | radius, | ||
| uint | w, | ||
| uint | h | ||
| ) |
See SpiralTileSequence constructor for description.
Definition at line 331 of file tilearea.cpp.
References InitPosition(), and SkipOutsideMap().
|
private |
Advance the internal state to the next potential tile.
The tile may be outside the map though.
Definition at line 365 of file tilearea.cpp.
References DIAGDIR_BEGIN, DIAGDIR_END, DIR_W, InitPosition(), INVALID_DIAGDIR, IsEnd(), TileIndexDiffCByDiagDir(), and TileIndexDiffCByDir().
Referenced by SkipOutsideMap().
|
private |
Initialise "position" after "dir" was changed.
Definition at line 356 of file tilearea.cpp.
Referenced by Increment(), SpiralTileIterator(), and SpiralTileIterator().
|
inlineprivate |
Test whether the iterator reached the end.
Definition at line 307 of file tilearea_type.h.
References INVALID_DIAGDIR.
Referenced by Increment(), and SkipOutsideMap().
|
inline |
Definition at line 273 of file tilearea_type.h.
|
inline |
Definition at line 275 of file tilearea_type.h.
|
inline |
Definition at line 282 of file tilearea_type.h.
|
inline |
Definition at line 270 of file tilearea_type.h.
|
inline |
Definition at line 271 of file tilearea_type.h.
|
private |
Advance the internal state until it reaches a valid tile or the end.
Definition at line 348 of file tilearea.cpp.
References Increment(), IsEnd(), Map::SizeX(), and Map::SizeY().
Referenced by SpiralTileIterator(), and SpiralTileIterator().
|
private |
Definition at line 295 of file tilearea_type.h.
|
private |
Definition at line 296 of file tilearea_type.h.
|
private |
Definition at line 292 of file tilearea_type.h.
|
private |
Definition at line 291 of file tilearea_type.h.
|
private |
Definition at line 297 of file tilearea_type.h.
|
private |
Definition at line 298 of file tilearea_type.h.
|
private |
Definition at line 298 of file tilearea_type.h.