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

Method getStock

game/ui/general/transactioncontrol.cpp:900–905  ·  view source on GitHub ↗

* Get current stock. * @param baseIdx - index of the base (economy) * @param oppositeIdx - index of the opposite base (economy) * @param currentStock - true for current, false for default (by default) * @return - the stock */

Source from the content-addressed store, hash-verified

898 * @return - the stock
899 */
900int TransactionControl::Trade::getStock(const int baseIdx, const int oppositeIdx,
901 bool currentStock) const
902{
903 return initialStock[baseIdx] - shipmentsFrom(baseIdx, oppositeIdx) -
904 (currentStock ? getOrder(baseIdx, oppositeIdx) : 0);
905}
906
907/**
908 * ScrollBar support. Set current value.

Callers 1

executeOrdersMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected