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

Method setBalance

game/ui/general/transactioncontrol.cpp:912–925  ·  view source on GitHub ↗

* ScrollBar support. Set current value. * @param balance - scrollBar->getValue() * @return - order from left to right side */

Source from the content-addressed store, hash-verified

910 * @return - order from left to right side
911 */
912int TransactionControl::Trade::setBalance(const int balance)
913{
914 int orderLR = balance - getRightStock();
915 if (orderLR == 0)
916 {
917 cancelOrder();
918 }
919 else
920 {
921 shipments[leftIdx][rightIdx] = orderLR;
922 shipments[rightIdx][leftIdx] = -orderLR;
923 }
924 return orderLR;
925}
926
927}; // namespace OpenApoc

Callers 1

updateValuesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected