10#ifndef STATION_LAYOUT_TYPE_H
11#define STATION_LAYOUT_TYPE_H
16template <StationType T>
17class RailStationTileLayout {
19 std::span<const StationGfx>
layout{};
25 if (spec ==
nullptr)
return;
29 if (found != std::end(spec->
layouts)) this->layout = found->second;
33 const RailStationTileLayout &
stl;
37 using difference_type = std::ptrdiff_t;
38 using iterator_category = std::forward_iterator_tag;
40 using reference = void;
42 Iterator(
const RailStationTileLayout &
stl) :
stl(
stl) {}
44 bool operator==(
const Iterator &rhs)
const {
return this->position == rhs.
position; }
45 bool operator==(
const std::default_sentinel_t &)
const {
return this->position == this->stl.
platforms * this->stl.
length; }
53 Iterator &operator++()
68 std::default_sentinel_t end()
const {
return std::default_sentinel_t(); }
const RailStationTileLayout & stl
Station tile layout being iterated.
uint position
Position within iterator.
StationGfx operator*() const
Dereference operator.
uint length
Length of platforms.
std::span< const StationGfx > layout
Predefined tile layout.
uint platforms
Number of platforms.
constexpr enum_type & operator++(enum_type &e)
Prefix increment.
uint8_t StationGfx
Copy from station_map.h.
Header file for NewGRF stations.
uint16_t GetStationLayoutKey(uint8_t platforms, uint8_t length)
Get the station layout key for a given station layout size.
Maps accessors for stations.
std::unordered_map< uint16_t, std::vector< uint8_t > > layouts
Custom platform layouts, keyed by platform and length combined.