10#ifndef TILEAREA_DIAGONAL_H
11#define TILEAREA_DIAGONAL_H
108 inline std::default_sentinel_t
end()
const
110 return std::default_sentinel_t();
Iterator to iterate over a diagonal area of the map.
uint base_y
The base tile y coordinate from where the iterating happens.
iterator & operator++()
Increment the iterator and set it to the next position.
std::ptrdiff_t difference_type
difference_type iterator trait
TileIndex operator*() const
Get the current tile.
TileIndex value_type
value_type iterator trait
bool operator==(const std::default_sentinel_t &) const
Compare with end sentinel.
int b_max
The (rotated) y coordinate of the end of the iteration.
int a_max
The (rotated) x coordinate of the end of the iteration.
uint base_x
The base tile x coordinate from where the iterating happens.
iterator(const DiagonalTileArea &ta)
Construct the iterator.
bool operator==(const iterator &) const =default
Compare with other iterator.
void reference
reference iterator trait
void pointer
pointer iterator trait
int b_cur
The current (rotated) y coordinate of the iteration.
std::forward_iterator_tag iterator_category
iterator_category iterator trait
TileIndex tile
The current tile.
int a_cur
The current (rotated) x coordinate of the iteration.
void Clear()
Clears the TileArea by making the tile invalid and setting a and b to 0.
int16_t b
Extent in diagonal "y" direction (may be negative to signify the area stretches upwards).
bool Contains(TileIndex tile) const
Does this tile area contain a tile?
int16_t a
Extent in diagonal "x" direction (may be negative to signify the area stretches to the left).
TileIndex tile
Base tile of the area.
std::default_sentinel_t end() const
Returns an iterator to the end of the tile area.
iterator begin() const
Returns an iterator to the start of the tile area.
DiagonalTileArea(TileIndex tile=INVALID_TILE, int16_t a=0, int16_t b=0)
Construct this tile area with some set values.
Functions related to maps.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
static uint TileX(TileIndex tile)
Get the X component of a tile.
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > > TileIndex
The index/ID of a Tile.
constexpr TileIndex INVALID_TILE
The very nice invalid tile marker.