示例#1
0
    public void AcceptOrder(Order orderToAccept)
    {
        if (requestedOrders.Count == 1 && acceptedOrders.Count == 0)
        {
            activeAliens[0].currentState = AlienState.WAITING;
        }
        else if (requestedOrders.Count == 1 && acceptedOrders.Count == 1)
        {
            activeAliens[1].currentState = AlienState.WAITING_2;
        }


        acceptedOrders.Add(orderToAccept);
        requestedOrders.Remove(requestedOrders[0]);
        currentScreenState = OrderScreenState.CURRENT_ORDER;

        isOrderAvailable = false;
    }
示例#2
0
    //public AlienAnimation alien1;
    //public AlienAnimation alien2;
    //public AlienAnimation alienStraggler;

    void Start()
    {
        gameManager  = GameManager.GetInstance();
        soundManager = gameManager.soundManager;

        activeAliens     = new List <AlienAnimation>();
        destroyingAliens = new List <AlienAnimation>();


        // Initialising all the lists. //
        requestedOrders  = new List <Order>();
        acceptedOrders   = new List <Order>();
        availableColours = new List <Colour>();

        currentScreenState = OrderScreenState.NEW_ORDER;

        // Initialising available colours //
        AddAllColours(availableColours);


        selectedOrder = -1;
    }
示例#3
0
    public void CompleteOrder(Soup soupToSubmit)
    {
        activeAliens[0].currentState = AlienState.LEAVING_HAPPILY;

        Debug.Log("ACCEPTED ORDERS COUNT: " + acceptedOrders.Count + "========================");
        Debug.Log("ACTIVE ALIENS ORDERS COUNT: " + activeAliens.Count + "========================");


        if (activeAliens.Count > 1 && activeAliens[1].currentState == AlienState.WAITING_2 && acceptedOrders.Count == 2)
        {
            Debug.Log("AHHHHHHHHHHHL OOK OVA HERE!");
            activeAliens[1].currentState = AlienState.WAITING;
        }

        destroyingAliens.Add(activeAliens[0]);
        destroyingAliens[0].destroy = true;

        activeAliens.Remove(activeAliens[0]);



        if (CompareOrder(soupToSubmit) == true)
        {
            RewardPoints(pointsForSuccessfulOrder);
            RewardTime(timeForSuccessfulOrder);
            Debug.Log("Correct order");
        }
        else
        {
            Debug.Log("Incorrect order.");
        }


        // Clearing order from list. //
        selectedOrder = -1;
        acceptedOrders.Remove(acceptedOrders[0]);
        currentScreenState = OrderScreenState.NEW_ORDER;
    }