예제 #1
0
        // constructor (SPAWN)
        public SodaMachine()
        {
            hopperIn  = new List <Coin>();
            hopperOut = new List <Coin>();
            register  = new List <Coin>();
            Quarter quarter = new Quarter();
            Dime    dime    = new Dime();
            Nickel  nickel  = new Nickel();
            Penny   penny   = new Penny();

            AddToInventory(quarter, 20);
            AddToInventory(dime, 10);
            AddToInventory(nickel, 20);
            AddToInventory(penny, 50);

            inventory = new List <Can>();
            Cola       cola       = new Cola();
            OrangeSoda orangeSoda = new OrangeSoda();
            RootBeer   rootBeer   = new RootBeer();

            AddToInventory(cola, 5);
            AddToInventory(orangeSoda, 5);
            AddToInventory(rootBeer, 5);

            cardPaymentBalance = 0;
        }
예제 #2
0
 public void StockOrangeSodaInSodaMachine(int howMany)
 {
     OrangeSoda orangeSoda = new OrangeSoda();
     for (int i = 0; i <= howMany; i++)
     {
         inventory.Add(orangeSoda);
     }
 }