|
OpenTTD Source 20260206-master-g4d4e37dbf1
|
Base class for tile iterators. More...
#include <tilearea_type.h>
Public Member Functions | |
| operator TileIndex () const | |
| Get the tile we are currently at. | |
| TileIndex | operator* () const |
| Get the tile we are currently at. | |
| virtual TileIterator & | operator++ ()=0 |
| Move ourselves to the next tile in the rectangle on the map. | |
| virtual std::unique_ptr< TileIterator > | Clone () const =0 |
| Allocate a new iterator that is a copy of this one. | |
| bool | operator== (const TileIterator &rhs) const |
| Equality comparison. | |
| bool | operator== (const TileIndex &rhs) const |
| Equality comparison. | |
Static Public Member Functions | |
| static std::unique_ptr< TileIterator > | Create (TileIndex corner1, TileIndex corner2, bool diagonal) |
| Create either an OrthogonalTileIterator or DiagonalTileIterator given the diagonal parameter. | |
Protected Member Functions | |
| TileIterator (TileIndex tile=INVALID_TILE) | |
| Initialise the iterator starting at this tile. | |
Protected Attributes | |
| TileIndex | tile |
| The current tile we are at. | |
Base class for tile iterators.
Definition at line 105 of file tilearea_type.h.
|
inlineprotected |
Initialise the iterator starting at this tile.
| tile | The tile we start iterating from. |
Definition at line 113 of file tilearea_type.h.
References INVALID_TILE, and tile.
Referenced by AirportTileTableIterator::AirportTileTableIterator(), DiagonalTileIterator::DiagonalTileIterator(), AirportTileIterator::operator++(), AirportTileTableIterator::operator++(), BitmapTileIterator::operator++(), DiagonalTileIterator::operator++(), OrthogonalTileIterator::operator++(), operator++(), operator==(), and OrthogonalTileIterator::OrthogonalTileIterator().
|
pure virtual |
Allocate a new iterator that is a copy of this one.
Implemented in AirportTileIterator, AirportTileTableIterator, BitmapTileIterator, DiagonalTileIterator, and OrthogonalTileIterator.
|
static |
Create either an OrthogonalTileIterator or DiagonalTileIterator given the diagonal parameter.
| corner1 | Tile from where to begin iterating. |
| corner2 | Tile where to end the iterating. |
| diagonal | Whether to create a DiagonalTileIterator or OrthogonalTileIterator. |
Definition at line 291 of file tilearea.cpp.
Referenced by CmdBuildCanal(), CmdBuildObjectArea(), CmdClearArea(), CmdConvertRail(), CmdConvertRoad(), CmdLevelLand(), CmdPlaceHouseArea(), and CmdPlantTree().
|
inline |
Get the tile we are currently at.
Definition at line 124 of file tilearea_type.h.
|
inline |
Get the tile we are currently at.
Definition at line 133 of file tilearea_type.h.
|
pure virtual |
Move ourselves to the next tile in the rectangle on the map.
Implemented in AirportTileIterator, AirportTileTableIterator, BitmapTileIterator, DiagonalTileIterator, and OrthogonalTileIterator.
References TileIterator().
|
inline |
Equality comparison.
Definition at line 159 of file tilearea_type.h.
|
inline |
Equality comparison.
Definition at line 151 of file tilearea_type.h.
References tile, and TileIterator().
|
protected |
The current tile we are at.
Definition at line 107 of file tilearea_type.h.
Referenced by DiagonalTileIterator::DiagonalTileIterator(), AirportTileIterator::operator++(), AirportTileTableIterator::operator++(), DiagonalTileIterator::operator++(), OrthogonalTileIterator::operator++(), operator==(), OrthogonalTileIterator::OrthogonalTileIterator(), and TileIterator().