12 #ifndef STATION_BASE_H
13 #define STATION_BASE_H
27 static const byte INITIAL_STATION_RATING = 175;
38 typedef std::map<uint32, StationID> SharesMap;
53 inline FlowStat(StationID st, uint flow,
bool restricted =
false)
68 inline void AppendShare(StationID st, uint flow,
bool restricted =
false)
119 assert(!this->
shares.empty());
122 return this->
shares.upper_bound(rand)->second;
134 assert(!this->
shares.empty());
140 StationID
GetVia(StationID excluded, StationID excluded2 = INVALID_STATION)
const;
157 void AddFlow(StationID origin, StationID via, uint amount);
158 void PassOnFlow(StationID origin, StationID via, uint amount);
215 rating(INITIAL_STATION_RATING),
281 inline StationID
GetVia(StationID source)
const
283 FlowStatMap::const_iterator flow_it(this->
flows.find(source));
284 return flow_it != this->
flows.end() ? flow_it->second.GetVia() : INVALID_STATION;
295 inline StationID
GetVia(StationID source, StationID excluded, StationID excluded2 = INVALID_STATION)
const
297 FlowStatMap::const_iterator flow_it(this->
flows.find(source));
298 return flow_it != this->
flows.end() ? flow_it->second.GetVia(excluded, excluded2) : INVALID_STATION;
361 default: NOT_REACHED();
465 byte time_since_load;
466 byte time_since_unload;
468 byte last_vehicle_type;
469 std::list<Vehicle *> loading_vehicles;
497 inline bool TileBelongsToAirport(
TileIndex tile)
const
502 uint32 GetNewGRFVariable(
const ResolverObject &
object, byte variable, byte parameter,
bool *available)
const;
507 #define FOR_ALL_STATIONS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Station, var)
521 if (!st->TileBelongsToAirport(this->tile)) ++(*
this);
526 (*this).OrthogonalTileIterator::operator++();
528 (*this).OrthogonalTileIterator::operator++();