| 589 | } |
| 590 | |
| 591 | bool 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 | |
| 625 | void TransactionScreen::attemptCloseScreen() |
| 626 | { |
nothing calls this directly
no test coverage detected