Пример #1
0
    /// <summary>
    /// When the customer is served it sets a int which determines which
    /// customer is served by which chef.
    /// After that it checks if the order is correct if it is, necessary score is calculated.
    /// if the order is not correct the customer starts losing time faster and if the correct
    /// order is not fed to the customer.
    /// </summary>
    private void CheckContents()
    {
        Customer currentcustomer = currentCollider.GetComponent <Customer>();

        if (gameObject.name == "Player_1")
        {
            currentcustomer.servedBy = 0;
        }
        else
        {
            currentcustomer.servedBy = 1;
        }

        bool isordercorrect = CheckOrder.CompareLists(saladToServe, currentcustomer.m_RequestedSalad);

        if (isordercorrect)
        {
            m_ChefScore += CalculateScore.m_Instance.CalculatePositiveScore(currentcustomer.m_RemainingTime, currentcustomer.m_WaitTime);
            ClearEverthing();
            Destroy(currentcustomer.gameObject);
        }
        else
        {
            currentcustomer.decreasemulti = 0.5f;
            ClearEverthing();
        }
    }