Esempio n. 1
0
 public Pitcher MakeNewPitcher()
 {
     pitcher = new Pitcher();
     inventory.RemoveCupsFromInventory(pitcher.cupsLeftInPitcher);
     inventory.RemoveLemonsFromInventory(recipe.amountOfLemons);
     inventory.RemoveSugarCubesFromInventory(recipe.amountOfSugarCubes);
     inventory.RemoveIceCubesFromInventory(recipe.amountOfIceCubes);
     return(pitcher);
 }
Esempio n. 2
0
 public void MakePitcher()
 {
     if (inventory.lemons.Count >= recipe.amountOfLemons && inventory.sugarCubes.Count >= recipe.amountOfSugarCubes && inventory.cups.Count > 0)
     {
         pitcher = new Pitcher();
         inventory.RemoveLemonsFromInventory(recipe.amountOfLemons);
         inventory.RemoveSugarCubesFromInventory(recipe.amountOfSugarCubes);
     }
 }
Esempio n. 3
0
        // member methods
        public bool MakePitcherOfLemonade()
        {
            if (inventory.lemons.Count >= recipe.amountOfLemons &&
                inventory.sugarCubes.Count >= recipe.amountOfSugarCubes)
            {
                pitcher.RefillPitcher();

                inventory.RemoveLemonsFromInventory(recipe.amountOfLemons);
                inventory.RemoveSugarCubesFromInventory(recipe.amountOfSugarCubes);

                return(true);
            }
            return(false);
        }