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;
55 inline FlowStat(StationID st, uint flow,
bool restricted =
false)
70 inline void AppendShare(StationID st, uint flow,
bool restricted =
false)
121 assert(!this->
shares.empty());
124 return this->
shares.upper_bound(rand)->second;
136 assert(!this->
shares.empty());
142 StationID
GetVia(StationID excluded, StationID excluded2 = INVALID_STATION)
const;
159 void AddFlow(StationID origin, StationID via, uint amount);
160 void PassOnFlow(StationID origin, StationID via, uint amount);
217 rating(INITIAL_STATION_RATING),
283 inline StationID
GetVia(StationID source)
const
285 FlowStatMap::const_iterator flow_it(this->
flows.find(source));
286 return flow_it != this->
flows.end() ? flow_it->second.GetVia() : INVALID_STATION;
297 inline StationID
GetVia(StationID source, StationID excluded, StationID excluded2 = INVALID_STATION)
const
299 FlowStatMap::const_iterator flow_it(this->
flows.find(source));
300 return flow_it != this->
flows.end() ? flow_it->second.GetVia(excluded, excluded2) : INVALID_STATION;
363 default: NOT_REACHED();
467 byte time_since_load;
468 byte time_since_unload;
470 byte last_vehicle_type;
471 std::list<Vehicle *> loading_vehicles;
499 inline bool TileBelongsToAirport(
TileIndex tile)
const
504 uint32 GetNewGRFVariable(
const ResolverObject &
object, byte variable, byte parameter,
bool *available)
const;
509 #define FOR_ALL_STATIONS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Station, var)
523 if (!st->TileBelongsToAirport(this->tile)) ++(*
this);
528 (*this).OrthogonalTileIterator::operator++();
530 (*this).OrthogonalTileIterator::operator++();