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

Method shipmentsFrom

game/ui/general/transactioncontrol.cpp:819–833  ·  view source on GitHub ↗

* Get the sum of shipment orders from the base (economy). * @param from - 0-7 for bases, 8 for economy * @param exclude - 0-7 for bases, 8 for economy, -1 don't exclude (by default) * @return - sum of shipment orders */

Source from the content-addressed store, hash-verified

817 * @return - sum of shipment orders
818 */
819int TransactionControl::Trade::shipmentsFrom(const int from, const int exclude) const
820{
821 int total = 0;
822 if (shipments.find(from) != shipments.end())
823 {
824 for (auto &s : shipments.at(from))
825 {
826 if (s.first != exclude && s.second > 0)
827 {
828 total += s.second;
829 }
830 }
831 }
832 return total;
833}
834
835/**
836 * Get total shipment orders from(+) and to(-) the base (economy).

Callers 3

closeScreenMethod · 0.80
executeOrdersMethod · 0.80
executeOrdersMethod · 0.80

Calls 1

endMethod · 0.80

Tested by

no test coverage detected