public ChangeStock(int oneThousands, int fiveHundreds, int oneHundreds, int fifties, int tens) { this.OneThousandStock = new ChangeGroup(Money.OneThousand, oneThousands); this.FiveHundredStock = new ChangeGroup(Money.FiveHundred, fiveHundreds); this.OneHundredStock = new ChangeGroup(Money.OneHundred, oneHundreds); this.FiftyStock = new ChangeGroup(Money.Fifty, fifties); this.TenStock = new ChangeGroup(Money.Ten, tens); }
private bool ReduceMoneyAndAddChange(ChangeGroup changes, List <Money> change, ref int total) { var maybeMoney = changes.DrawMoney(); if (maybeMoney.IsSome) { var money = maybeMoney.Value; change.Add(money); total -= money.Value; return(false); } else { return(true); } }
private bool ReduceMoneyAndAddChange(ChangeGroup changes, List<Money> change, ref int total) { var maybeMoney = changes.DrawMoney(); if (maybeMoney.IsSome) { var money = maybeMoney.Value; change.Add(money); total -= money.Value; return false; } else { return true; } }