public USDRandomDispenser(
     CoinChamber <Penny> pennies,
     CoinChamber <Nickle> nickles,
     CoinChamber <Dime> dimes,
     CoinChamber <Quarter> quarters,
     CoinChamber <Dollar> dollars) : base(pennies, nickles, dimes, quarters, dollars)
 {
 }
예제 #2
0
 public Dispenser(
     CoinChamber <Penny> pennies,
     CoinChamber <Nickle> nickles,
     CoinChamber <Dime> dimes,
     CoinChamber <Quarter> quarters,
     CoinChamber <Dollar> dollars)
 {
     dispenser = new List <ICoinChamber>();
     dispenser.Add(pennies);
     dispenser.Add(nickles);
     dispenser.Add(dimes);
     dispenser.Add(quarters);
     dispenser.Add(dollars);
     dispenser = dispenser
                 .Where(x => x.Coin.Currency == currency)
                 .OrderByDescending(x => x.Coin.Value)
                 .ToList();
 }