public void AddToVegePlate(VegePlate choppingBoardPlate) { for (int i = 0; i < choppingBoardPlate.vegetablesOnPlate.Count; i++) { vegePlate.vegetablesOnPlate.Add(choppingBoardPlate.vegetablesOnPlate[i]); } AddToInventory(vegePlate); }
public void RemoveVegePlate() { VegePlate vegPlate = CheckForPlate(); inventory.Remove(vegPlate); vegePlate.vegetablesOnPlate.Clear(); UIManager.Instance.UpdateText(text, inventory.ToArray(), inventory.Count); }
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); } } } }
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(); } }
public void Start() { inventory = new List <Vegetable>(); controls = GetComponent <Controls>(); vegePlate = GetComponent <VegePlate>(); }
public void Start() { vegePlate = GetComponent <VegePlate>(); }