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

Function sortVehicleList

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

Source from the content-addressed store, hash-verified

900 }
901
902 static void sortVehicleList(Window& self)
903 {
904 auto list = std::span<EntityId>(reinterpret_cast<EntityId*>(self.rowInfo), self.rowCount);
905
906 std::sort(list.begin(), list.end(), [self](EntityId lhs, EntityId rhs) {
907 auto* lhsVehicle = EntityManager::get<VehicleHead>(lhs);
908 auto* rhsVehicle = EntityManager::get<VehicleHead>(rhs);
909 return orderByName(*lhsVehicle, *rhsVehicle);
910 });
911
912 self.invalidate();
913 }
914
915 void removeTrainFromList(Window& self, EntityId head)
916 {

Callers 2

populateVehicleListFunction · 0.70
onUpdateFunction · 0.70

Calls 4

orderByNameFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
invalidateMethod · 0.45

Tested by

no test coverage detected