MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / populateVehicleList

Function populateVehicleList

src/OpenLoco/src/Ui/Windows/StationWindow.cpp:857–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

855 }
856
857 static void populateVehicleList(Window& self)
858 {
859 self.rowCount = 0;
860
861 // Populate vehicle list with relevant entity ids
862 auto currentVehicleType = getCurrentVehicleType(self);
863 for (auto* vehicle : VehicleManager::VehicleList())
864 {
865 if (!vehicleStopsAtActiveStation(vehicle, StationId(self.number)))
866 {
867 continue;
868 }
869
870 Common::setVehicleTypeAvailable(self, vehicle->vehicleType);
871
872 if (vehicle->vehicleType != currentVehicleType)
873 {
874 continue;
875 }
876
877 self.rowInfo[self.rowCount++] = enumValue(vehicle->head);
878 }
879
880 sortVehicleList(self);
881 }
882
883 static bool orderByName(const VehicleHead& lhs, const VehicleHead& rhs)
884 {

Callers 2

openFunction · 0.70
switchTabFunction · 0.70

Calls 6

getCurrentVehicleTypeFunction · 0.85
StationIdEnum · 0.85
setVehicleTypeAvailableFunction · 0.85
enumValueFunction · 0.85
sortVehicleListFunction · 0.70

Tested by

no test coverage detected