예제 #1
0
 public void AddToVegePlate(VegePlate choppingBoardPlate)
 {
     for (int i = 0; i < choppingBoardPlate.vegetablesOnPlate.Count; i++)
     {
         vegePlate.vegetablesOnPlate.Add(choppingBoardPlate.vegetablesOnPlate[i]);
     }
     AddToInventory(vegePlate);
 }
예제 #2
0
    public void RemoveVegePlate()
    {
        VegePlate vegPlate = CheckForPlate();

        inventory.Remove(vegPlate);
        vegePlate.vegetablesOnPlate.Clear();
        UIManager.Instance.UpdateText(text, inventory.ToArray(), inventory.Count);
    }
예제 #3
0
 public void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Vegetable")
     {
         AddToInventory(collision.GetComponent <Vegetable>());
     }
     if (collision.tag == "Customer")
     {
         if (inventory.Count > 0)
         {
             VegePlate vege = CheckForPlate();//returns vege plate
             if (vege != null)
             {
                 collision.GetComponent <Customer>().CheckPlates(vege, this);
                 inventory.Remove(vege);//removes vege plate
                 vegePlate.vegetablesOnPlate.Clear();
                 UIManager.Instance.UpdateText(text, inventory.ToArray(), inventory.Count);
             }
         }
     }
 }
예제 #4
0
 public void CheckPlates(VegePlate vegePlate, Player player)
 {
     AddPlayer(player);
     if (vegePlate.vegetablesOnPlate.Count == plateRequest.Count)
     {
         //Part1 Check if vegePlate has the ingredients
         for (int i = 0; i < plateRequest.Count; i++)
         {
             VegetableType vType = plateRequest[i].typeOfVegetable;
             if (vegePlate.vegetablesOnPlate.Contains(plateRequest[i]))//(vegePlate.vegetablesOnPlate.Find(s => s.typeOfVegetable == vType))
             {
                 vegePlate.vegetablesOnPlate.Remove(vegePlate.vegetablesOnPlate.Find(s => s.typeOfVegetable == vType));
                 correctNumberOfIngredients++;
             }
         }
         //Part2 decides what mood the customer will be in
         if (correctNumberOfIngredients == plateRequest.Count)
         {
             float happinessCheck = currentPatience / customerPatience;
             if (happinessCheck > .70f)
             {
                 ChangeMood(CustomerMood.Happy);
             }
             else
             {
                 ChangeMood(CustomerMood.Satisfied);
             }
             correctNumberOfIngredients = 0;
             CheckResult(player, scoreBonus);
         }
         else
         {
             IncorrectOrder();
         }
     }
     else
     {
         IncorrectOrder();
     }
 }
예제 #5
0
 public void Start()
 {
     inventory = new List <Vegetable>();
     controls  = GetComponent <Controls>();
     vegePlate = GetComponent <VegePlate>();
 }
예제 #6
0
 public void Start()
 {
     vegePlate = GetComponent <VegePlate>();
 }