diff options
author | tron <tron@openttd.org> | 2007-01-31 04:34:56 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2007-01-31 04:34:56 +0000 |
commit | f5b41a2fbb5e164f1c103e7f6d3cd4babb2aaa84 (patch) | |
tree | 8afaea6febb39a36db50ccc890f5b6804c9e898b /src/station_cmd.cpp | |
parent | d838a477e21ff1fe5c54e198462dd006d51227f7 (diff) | |
download | openttd-f5b41a2fbb5e164f1c103e7f6d3cd4babb2aaa84.tar.xz |
(svn r8474) -Fix
Turn GetPrimaryRoadStop() into a method of struct Station
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 12b2f417b..b3ac6e70b 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -80,23 +80,12 @@ DEFINE_OLD_POOL(RoadStop, RoadStop, RoadStopPoolNewBlock, NULL) extern void UpdateAirplanesOnNewStation(Station *st); -RoadStop* GetPrimaryRoadStop(const Station* st, RoadStop::Type type) -{ - switch (type) { - case RoadStop::BUS: return st->bus_stops; - case RoadStop::TRUCK: return st->truck_stops; - default: NOT_REACHED(); - } - - return NULL; -} - RoadStop* GetRoadStopByTile(TileIndex tile, RoadStop::Type type) { const Station* st = GetStationByTile(tile); RoadStop* rs; - for (rs = GetPrimaryRoadStop(st, type); rs->xy != tile; rs = rs->next) { + for (rs = st->GetPrimaryRoadStop(type); rs->xy != tile; rs = rs->next) { assert(rs->next != NULL); } @@ -109,7 +98,7 @@ uint GetNumRoadStopsInStation(const Station* st, RoadStop::Type type) const RoadStop *rs; assert(st != NULL); - for (rs = GetPrimaryRoadStop(st, type); rs != NULL; rs = rs->next) num++; + for (rs = st->GetPrimaryRoadStop(type); rs != NULL; rs = rs->next) num++; return num; } |