|
OpenTTD Source 20261112-master-gbcbec5e63f
|
Iterator to iterate over a tile area (rectangle) of the map. More...
#include <tilearea_orthogonal.h>
Public Types | |
| using | value_type = TileIndex |
| value_type iterator trait | |
| using | difference_type = std::ptrdiff_t |
| difference_type iterator trait | |
| using | iterator_category = std::forward_iterator_tag |
| iterator_category iterator trait | |
| using | pointer = void |
| pointer iterator trait | |
| using | reference = void |
| reference iterator trait | |
Public Member Functions | |
| iterator (const OrthogonalTileArea &ta) | |
| Construct the iterator. | |
| bool | operator== (const iterator &) const =default |
| Compare with other iterator. | |
| bool | operator== (const std::default_sentinel_t &) const |
| Compare with end sentinel. | |
| TileIndex | operator* () const |
| Get the current tile. | |
| iterator & | operator++ () |
| Increment the iterator and set it to the next position. | |
Private Attributes | |
| TileIndex | tile |
| The current tile. | |
| int | w |
| The width of the iterated area. | |
| int | x |
| The current 'x' position in the rectangle. | |
| int | y |
| The current 'y' position in the rectangle. | |
Iterator to iterate over a tile area (rectangle) of the map.
Definition at line 79 of file tilearea_orthogonal.h.
| using OrthogonalTileArea::iterator::difference_type = std::ptrdiff_t |
difference_type iterator trait
Definition at line 88 of file tilearea_orthogonal.h.
| using OrthogonalTileArea::iterator::iterator_category = std::forward_iterator_tag |
iterator_category iterator trait
Definition at line 89 of file tilearea_orthogonal.h.
| using OrthogonalTileArea::iterator::pointer = void |
pointer iterator trait
Definition at line 90 of file tilearea_orthogonal.h.
| using OrthogonalTileArea::iterator::reference = void |
reference iterator trait
Definition at line 91 of file tilearea_orthogonal.h.
value_type iterator trait
Definition at line 87 of file tilearea_orthogonal.h.
|
inlineexplicit |
Construct the iterator.
| ta | Area, i.e. begin point and width/height of to-be-iterated area. |
Definition at line 97 of file tilearea_orthogonal.h.
References OrthogonalTileArea::h, INVALID_TILE, OrthogonalTileArea::OrthogonalTileArea(), tile, w, x, and y.
Referenced by operator++(), and operator==().
|
inline |
Get the current tile.
Definition at line 118 of file tilearea_orthogonal.h.
|
inline |
Increment the iterator and set it to the next position.
Definition at line 127 of file tilearea_orthogonal.h.
References INVALID_TILE, iterator(), and TileDiffXY().
|
default |
Compare with other iterator.
true iff the other iterator matches this value. References iterator().
|
inline |
Compare with end sentinel.
true iff this iterator is at the end. Definition at line 109 of file tilearea_orthogonal.h.
References INVALID_TILE.
|
private |
|
private |
The width of the iterated area.
Definition at line 82 of file tilearea_orthogonal.h.
Referenced by iterator().
|
private |
The current 'x' position in the rectangle.
Definition at line 83 of file tilearea_orthogonal.h.
Referenced by iterator().
|
private |
The current 'y' position in the rectangle.
Definition at line 84 of file tilearea_orthogonal.h.
Referenced by iterator().