Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         List <Food.FoodType> matchingOrder = OrderGen.GetOrder(order);
         if (matchingOrder == null)
         {
             Debug.Log("no matching order");
         }
         else
         {
             OrderGen.RemoveOrder(matchingOrder);
         }
     }
 }
Exemplo n.º 2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Plate")
        {
            Debug.Log("This appears to be a Plate!");
            if (other.GetComponent <PlateScript>() != null)
            {
                _plateScript = other.GetComponent <PlateScript>();
            }


            // Debug.Log("!!!!!!: " + _plateScript.platedSushi.Count);

            // Iterate through hashset and add each element to the list

            List <Food.FoodType> plateFoodTypes = ConvertHashSetToList(_plateScript.platedSushi);

            // run CompareList()
            List <Food.FoodType> matchingOrder = orderGenerator.GetOrder(plateFoodTypes);

            // If the plate's list doesn't match one of the Orders
            if (matchingOrder == null)
            {
                Debug.Log("doesn't match an order");
                //aM.Play("");

                myScore.score -= 50f;
            }
            // If the plate's list matches one of the order remove the order and get rid of plate
            else
            {
                orderGenerator.RemoveOrder(matchingOrder);
                Debug.Log("matching");
                //aM.Play("");

                myScore.score += 100f;
            }
        }
    }