summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2007-01-25 10:06:58 +0000
committercelestar <celestar@openttd.org>2007-01-25 10:06:58 +0000
commitb0a0086e7cd09d4bd28838fb3aa0fec6b9fc7857 (patch)
treedd1d248343ebc3dd9af716726f0d4ebc74c285f0 /src/station_cmd.cpp
parent600cb8a314eb1165bcef1309ebe3b7fd237e9778 (diff)
downloadopenttd-b0a0086e7cd09d4bd28838fb3aa0fec6b9fc7857.tar.xz
(svn r8402) -Codechange: Move RoadStop-specific enums to the RoadStop class, and changed a one-member enum into a static const. Simplify their naming and add some doxygen-comments to RoadStop
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 8cef0f4bc..49af7243a 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -81,18 +81,18 @@ DEFINE_OLD_POOL(RoadStop, RoadStop, RoadStopPoolNewBlock, NULL)
extern void UpdateAirplanesOnNewStation(Station *st);
-RoadStop* GetPrimaryRoadStop(const Station* st, RoadStopType type)
+RoadStop* GetPrimaryRoadStop(const Station* st, RoadStop::Type type)
{
switch (type) {
- case RS_BUS: return st->bus_stops;
- case RS_TRUCK: return st->truck_stops;
+ case RoadStop::BUS: return st->bus_stops;
+ case RoadStop::TRUCK: return st->truck_stops;
default: NOT_REACHED();
}
return NULL;
}
-RoadStop* GetRoadStopByTile(TileIndex tile, RoadStopType type)
+RoadStop* GetRoadStopByTile(TileIndex tile, RoadStop::Type type)
{
const Station* st = GetStationByTile(tile);
RoadStop* rs;
@@ -104,7 +104,7 @@ RoadStop* GetRoadStopByTile(TileIndex tile, RoadStopType type)
return rs;
}
-uint GetNumRoadStopsInStation(const Station* st, RoadStopType type)
+uint GetNumRoadStopsInStation(const Station* st, RoadStop::Type type)
{
uint num = 0;
const RoadStop *rs;
@@ -1299,7 +1299,7 @@ int32 DoConvertStationRail(TileIndex tile, RailType totype, bool exec)
* then point into the global roadstop array. *prev (in CmdBuildRoadStop)
* is the pointer tino the global roadstop array which has *currstop in
* its ->next element.
- * @param[in] truck_station Determines whether a stop is RS_BUS or RS_TRUCK
+ * @param[in] truck_station Determines whether a stop is RoadStop::BUS or RoadStop::TRUCK
* @param[in] station The station to do the whole procedure for
* @param[out] currstop See the detailed function description
* @param prev See the detailed function description
@@ -1369,7 +1369,7 @@ int32 CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
std::auto_ptr<RoadStop> rs_auto_delete(road_stop);
if (st != NULL &&
- GetNumRoadStopsInStation(st, RS_BUS) + GetNumRoadStopsInStation(st, RS_TRUCK) >= ROAD_STOP_LIMIT) {
+ GetNumRoadStopsInStation(st, RoadStop::BUS) + GetNumRoadStopsInStation(st, RoadStop::TRUCK) >= ROAD_STOP_LIMIT) {
return_cmd_error(type ? STR_3008B_TOO_MANY_TRUCK_STOPS : STR_3008A_TOO_MANY_BUS_STOPS);
}
@@ -1418,7 +1418,7 @@ int32 CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
st->rect.BeforeAddTile(tile, StationRect::ADD_TRY);
- MakeRoadStop(tile, st->owner, st->index, type ? RS_TRUCK : RS_BUS, (DiagDirection)p1);
+ MakeRoadStop(tile, st->owner, st->index, type ? RoadStop::TRUCK : RoadStop::BUS, (DiagDirection)p1);
UpdateStationVirtCoordDirty(st);
UpdateStationAcceptance(st, false);
@@ -1444,10 +1444,10 @@ static int32 RemoveRoadStop(Station *st, uint32 flags, TileIndex tile)
if (is_truck) { // truck stop
primary_stop = &st->truck_stops;
- cur_stop = GetRoadStopByTile(tile, RS_TRUCK);
+ cur_stop = GetRoadStopByTile(tile, RoadStop::TRUCK);
} else {
primary_stop = &st->bus_stops;
- cur_stop = GetRoadStopByTile(tile, RS_BUS);
+ cur_stop = GetRoadStopByTile(tile, RoadStop::BUS);
}
assert(cur_stop != NULL);