Exemplo n.º 1
0
    public void checkNeighboursHaveSingleColour()
    {
        Colour[] slotColours = new Colour[4];

        for (int i = 0; i < 4; i++)
        {
            slotColours[i] = slotNeighbours[i].GetComponent <Slot>().colour;
        }

        bool allSlotsTheSameColour = slotColours[0] != Colour.NONE &&
                                     slotColours[0] == slotColours[1] &&
                                     slotColours[0] == slotColours[2] &&
                                     slotColours[0] == slotColours[3];

        if (allSlotsTheSameColour)
        {
            GameTracker.respondToSingleColourNode();  // Set needToGoAgain to true, iterate squaresCompleted and score

            for (int i = 0; i < 4; i++)
            {
                slotNeighbours[i].GetComponent <Slot>().setSlotFlags(i, slotColours[i]);
            }
        }
    }