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

Function removeCompany

src/OpenLoco/src/Ui/Windows/CompanyList.cpp:598–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596 }
597
598 void removeCompany(CompanyId id)
599 {
600 auto* window = WindowManager::find(WindowType::companyList);
601 if (window == nullptr)
602 {
603 return;
604 }
605
606 auto list = std::span<CompanyId>(reinterpret_cast<CompanyId*>(window->rowInfo), window->rowCount);
607
608 auto newEnd = std::remove_if(list.begin(), list.end(), [id](CompanyId el) { return el == id; });
609 auto numRemoved = std::distance(newEnd, list.end());
610
611 if (numRemoved > 0)
612 {
613 window->rowCount -= numRemoved;
614 }
615
616 WindowManager::invalidate(WindowType::companyList);
617 }
618
619 // 0x00435C69
620 void openPerformanceIndexes()

Callers 2

aiDestroyFunction · 0.85
drawScrollFunction · 0.85

Calls 4

findFunction · 0.85
invalidateFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected