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

Function removeTrainFromList

src/OpenLoco/src/Ui/Windows/VehicleList.cpp:423–434  ·  view source on GitHub ↗

0x004C1D19

Source from the content-addressed store, hash-verified

421
422 // 0x004C1D19
423 void removeTrainFromList(Window& self, EntityId head)
424 {
425 auto list = std::span<EntityId>(reinterpret_cast<EntityId*>(self.rowInfo), self.rowCount);
426
427 auto newEnd = std::remove_if(list.begin(), list.end(), [head](EntityId el) { return el == head; });
428 auto numRemoved = std::distance(newEnd, list.end());
429
430 if (numRemoved > 0)
431 {
432 self.rowCount -= numRemoved;
433 }
434 }
435
436 static Widx getTabFromType(VehicleType type)
437 {

Callers 2

drawScrollFunction · 0.70
deleteTrainFunction · 0.50

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected