MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / isClosable

Method isClosable

game/ui/base/transactionscreen.cpp:591–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591bool TransactionScreen::isClosable() const
592{
593 std::set<sp<TransactionControl>> linkedControls;
594 for (auto &l : transactionControls)
595 {
596 for (auto &c : l.second)
597 {
598 if (linkedControls.find(c) != linkedControls.end())
599 {
600 continue;
601 }
602
603 int i = 0;
604 for ([[maybe_unused]] auto &b : state->player_bases)
605 {
606 if (c->tradeState.shipmentsTotal(i++))
607 {
608 return false;
609 }
610 }
611
612 if (c->getLinked())
613 {
614 for (auto &l : *c->getLinked())
615 {
616 linkedControls.insert(l.lock());
617 }
618 }
619 }
620 }
621
622 return true;
623}
624
625void TransactionScreen::attemptCloseScreen()
626{

Callers

nothing calls this directly

Calls 3

endMethod · 0.80
shipmentsTotalMethod · 0.80
insertMethod · 0.80

Tested by

no test coverage detected