10#ifndef TILEAREA_WRAPPER_H
11#define TILEAREA_WRAPPER_H
21 { *iter } -> std::same_as<TileIndex>;
74 return std::visit(dereference_visitor{}, this->
iter);
83 std::visit(increment_visitor{}, this->
iter);
88 std::variant<Titer...>
iter;
130 template <
typename T>
139 template <
typename T>
150 return std::visit(begin_visitor{}, this->
area);
157 inline std::default_sentinel_t
end()
const
159 return std::default_sentinel_t();
169 return std::visit(contains_visitor{tile}, this->
area);
199 return area.Contains(this->tile);
iterator begin() const
Returns an iterator to the start of the tile area.
std::default_sentinel_t end() const
Returns an iterator to the end of the tile area.
TileAreaWrapper(T &&area)
Construct a new tile area wrapper.
bool Contains(TileIndex tile) const
Test if a tile is part of the tile area.
std::variant< Tarea... > area
TileAreaWrapper(const T &area)
Construct a new tile area wrapper.
TileIndex operator*() const
Get the current tile.
TileIteratorWrapper & operator++()
Increment the iterator and set it to the next position.
bool operator==(const TileIteratorWrapper &other) const
Compare with other iterator.
bool operator==(const std::default_sentinel_t &) const
Compare with end sentinel.
std::forward_iterator_tag iterator_category
std::ptrdiff_t difference_type
TileIteratorWrapper(TileIterator auto &&iter)
Construct the iterator wrapper.
TileIteratorWrapper(const TileIterator auto &iter)
Construct the iterator wrapper.
std::variant< Titer... > iter
A type is considered a TileIterator when it has a dereference operator that returns as TileIndex.
#define T
Climate temperate.
Visitor to call the underlying tile area's begin method.
iterator operator()(const auto &area)
Get the iterator for the underlying tile area.
Visitor to call the underlying tile area's contains method.
bool operator()(const auto &area)
Test if the underlying tile area contains a tile.
TileIndex tile
The tile to test.
Visitor to call the underlying tile iterator's dereference operator.
TileIndex operator()(const auto &iter)
Call the underlying iterator's dereference operator.
Visitor to call the underlying tile iterator's increment operator.
void operator()(auto &iter)
Call the underlying iterator's increment operator.
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.