Codechange: Make StationType an enum class. (#13339)
This commit is contained in:
@@ -146,7 +146,7 @@ public:
|
||||
[[fallthrough]];
|
||||
|
||||
case OT_GOTO_STATION:
|
||||
this->dest_tile = CalcClosestStationTile(v->current_order.GetDestination(), v->tile, v->current_order.IsType(OT_GOTO_STATION) ? STATION_RAIL : STATION_WAYPOINT);
|
||||
this->dest_tile = CalcClosestStationTile(v->current_order.GetDestination(), v->tile, v->current_order.IsType(OT_GOTO_STATION) ? StationType::Rail : StationType::RailWaypoint);
|
||||
this->dest_station_id = v->current_order.GetDestination();
|
||||
this->dest_trackdirs = INVALID_TRACKDIR_BIT;
|
||||
break;
|
||||
|
||||
@@ -242,13 +242,13 @@ public:
|
||||
{
|
||||
if (v->current_order.IsType(OT_GOTO_STATION)) {
|
||||
this->dest_station = v->current_order.GetDestination();
|
||||
this->station_type = v->IsBus() ? STATION_BUS : STATION_TRUCK;
|
||||
this->station_type = v->IsBus() ? StationType::Bus : StationType::Truck;
|
||||
this->dest_tile = CalcClosestStationTile(this->dest_station, v->tile, this->station_type);
|
||||
this->non_artic = !v->HasArticulatedPart();
|
||||
this->dest_trackdirs = INVALID_TRACKDIR_BIT;
|
||||
} else if (v->current_order.IsType(OT_GOTO_WAYPOINT)) {
|
||||
this->dest_station = v->current_order.GetDestination();
|
||||
this->station_type = STATION_ROADWAYPOINT;
|
||||
this->station_type = StationType::RoadWaypoint;
|
||||
this->dest_tile = CalcClosestStationTile(this->dest_station, v->tile, this->station_type);
|
||||
this->non_artic = !v->HasArticulatedPart();
|
||||
this->dest_trackdirs = INVALID_TRACKDIR_BIT;
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
{
|
||||
if (v->current_order.IsType(OT_GOTO_STATION)) {
|
||||
this->dest_station = v->current_order.GetDestination();
|
||||
this->dest_tile = CalcClosestStationTile(this->dest_station, v->tile, STATION_DOCK);
|
||||
this->dest_tile = CalcClosestStationTile(this->dest_station, v->tile, StationType::Dock);
|
||||
this->dest_trackdirs = INVALID_TRACKDIR_BIT;
|
||||
} else {
|
||||
this->dest_station = INVALID_STATION;
|
||||
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
DestinationID station_id = v->current_order.GetDestination();
|
||||
const BaseStation *station = BaseStation::Get(station_id);
|
||||
TileArea tile_area;
|
||||
station->GetTileArea(&tile_area, STATION_DOCK);
|
||||
station->GetTileArea(&tile_area, StationType::Dock);
|
||||
for (const auto &tile : tile_area) {
|
||||
if (IsDockingTile(tile) && IsShipDestinationTile(tile, station_id)) {
|
||||
pf.AddOrigin(GetWaterRegionPatchInfo(tile));
|
||||
|
||||
Reference in New Issue
Block a user