Codechange: change DestinationID into class with conversion helpers

A DestinationID is either a DepotID or StationID, where the aircraft hangar
being conceptually a depot is actually a StationID. When making those types
stronger, a lot of casts would need to be added, but this shows the intent
much better.
This commit is contained in:
Rubidium
2025-02-02 21:48:07 +01:00
committed by rubidium42
parent 8ca03a3766
commit e937c4dcfd
23 changed files with 84 additions and 64 deletions

View File

@@ -35,7 +35,7 @@ ScriptStationList_Vehicle::ScriptStationList_Vehicle(VehicleID vehicle_id)
const Vehicle *v = ::Vehicle::Get(vehicle_id);
for (Order *o = v->GetFirstOrder(); o != nullptr; o = o->next) {
if (o->IsType(OT_GOTO_STATION)) this->AddItem(o->GetDestination());
if (o->IsType(OT_GOTO_STATION)) this->AddItem(o->GetDestination().ToStationID());
}
}