public void cashOutPocket() { //convert all of the chips to money using chiphelper and add to user payment method ChipHelper ch = new ChipHelper(); double cashValue = 0; foreach (var item in AllChips) { cashValue += ch.chipsToCash(item); } CashInPocket = cashValue; }
public void convertToChips(double money) { //convert inserted money to chips for user and add to pocket if (CashInPocket - money > 0) { CashInPocket -= money; AllChips = new ChipHelper().convertCashToChips(money); } else { throw new Exception("Not Enough Cash in Pocket."); } }