Example #1
0
    private void CheckIfPlayerWins()
    {
        if (tilesOwnedByPlayer.Count >= 7)
        {
            foreach (Tile tile in tilesOwnedByPlayer)
            {
                if (tile.leftEdge)
                {
                    leftEdge = true;
                }

                if (tile.rightEdge)
                {
                    rightEdge = true;
                }

                if (tile.bottomEdge)
                {
                    bottomEdge = true;
                }

                if (leftEdge && rightEdge && bottomEdge)
                {
                    weHaveWinner = true;
                    gameEnd.WeHaveWinner();
                    break;
                }
            }
        }
    }