Ejemplo n.º 1
0
 private void UpdateButtons(bool row, int index, bool bigArrow)
 {
     if (CompareWith(backupBoard))
     {
         hasShifted = false;
         EnableArrows?.Invoke();
     }
     else
     {
         hasShifted = true;
         UpdateArrowsState?.Invoke(row, index, bigArrow);
     }
 }
Ejemplo n.º 2
0
    /// <summary>
    /// Sets the board and all the squares to empty
    /// </summary>
    public void CleanBoard()
    {
        for (int i = 0; i < 4; i++)
        {
            for (int j = 0; j < 4; j++)
            {
                board[i, j]       = Marks.Empty;
                backupBoard[i, j] = Marks.Empty;
                squares[i, j].Set(Marks.Empty);
            }
        }

        emptySquares = 16;
        SelectFirstPlayer();
        EnableArrows?.Invoke();
        OnEndGame?.Invoke();
        hasShifted = false;
        isInGame   = true;
        winGamePanel.gameObject.SetActive(false);
    }