예제 #1
0
 public void AddCup(decimal buyCup)
 {
     for (int i = 0; i < buyCup; i++)
     {
         Cup cup = new Cup();
         cups.Add(cup);
     }
 }
예제 #2
0
        public void AddItemsToInventory(int quantity, string item)
        {
            switch (item)
            {
            case "cups":
                for (int i = 0; i < quantity; i++)
                {
                    Cup cup = new Cup();
                    cups.Add(cup);
                }
                break;

            case "lemons":
                for (int i = 0; i < quantity; i++)
                {
                    Lemon lemon = new Lemon();
                    lemons.Add(lemon);
                }
                break;

            case "sugar":
                for (int i = 0; i < quantity; i++)
                {
                    SugarCup sug = new SugarCup();
                    sugarCups.Add(sug);
                }
                break;

            case "ice":
                for (int i = 0; i < quantity; i++)
                {
                    IceCube ice = new IceCube();
                    iceCubes.Add(ice);
                }
                break;
            }
        }