@@ -160,14 +160,12 @@ struct BaseStation : StationPool::PoolIt
return (this->facilities & ~FACIL_WAYPOINT) != 0;
}
static void PostDestructor(size_t index);
};
#define FOR_ALL_BASE_STATIONS(var) FOR_ALL_ITEMS_FROM(BaseStation, station_index, var, 0)
/**
* Class defining several overloaded accessors so we don't
* have to cast base stations that often
*/
template <class T, bool Tis_waypoint>
struct SpecializedStation : public BaseStation {
@@ -249,11 +247,16 @@ struct SpecializedStation : public BaseS
static inline const T *From(const BaseStation *st)
{
assert(IsExpected(st));
return (const T *)st;
* Returns an iterable ensemble of all valid stations of type T
* @param from index of the first station to consider
* @return an iterable ensemble of all valid stations of type T
static Pool::IterateWrapper<T> Iterate(size_t from = 0) { return Pool::IterateWrapper<T>(from); }
#define FOR_ALL_BASE_STATIONS_OF_TYPE(name, var) FOR_ALL_ITEMS_FROM(name, station_index, var, 0) if (name::IsExpected(var))
#endif /* BASE_STATION_BASE_H */