// Checks for the following pattern vertically "XXXX"
        bool VerticalCheck(BoardSpace space)
        {
            bool win = true;
            for (int i = 1; i < 4; i++)
            {
                if (GetSpace(space.XPos, space.YPos + i).SpaceColor != space.SpaceColor)
                {
                    win = false;
                }
            }

            if (win)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos, space.YPos + 1);
                _winningSpots[2] = GetSpace(space.XPos, space.YPos + 2);
                _winningSpots[3] = GetSpace(space.XPos, space.YPos + 3);
            }

            return win;
        }
 public void SetBoard()
 {
     if (_firstSet)
     {
         for (int i = 0; i < BOARD_HEIGHT; i++)
         {
             for (int j = 0; j < BOARD_WIDTH; j++)
             {
                 _board[j, i] = new BoardSpace("-", j, i);
             }
         }
         _firstSet = false;
     }
     else
     {
         foreach (BoardSpace b in _board)
         {
             b.SpaceColor = "-";
         }
     }
     _winningSpots[0] = null;
     _winningSpots[1] = null;
     _winningSpots[2] = null;
     _winningSpots[3] = null;
 }
        // Checks for the following pattern vertically "XXX-"
        bool OpenVerticalCheck(BoardSpace space)
        {
            bool downWin = false;
            bool upWin = false;
            if (GetSpace(space.XPos, space.YPos + 1).SpaceColor == space.SpaceColor && GetSpace(space.XPos, space.YPos + 2).SpaceColor == space.SpaceColor &&
                GetSpace(space.XPos, space.YPos + 3).SpaceColor == "-")
            {
                downWin = true;
            }

            if (GetSpace(space.XPos, space.YPos - 1).SpaceColor == space.SpaceColor && GetSpace(space.XPos, space.YPos - 2).SpaceColor == space.SpaceColor &&
                GetSpace(space.XPos, space.YPos - 3).SpaceColor == "-")
            {
                upWin = true;
            }

            if (downWin)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos, space.YPos + 1);
                _winningSpots[2] = GetSpace(space.XPos, space.YPos + 2);
                _winningSpots[3] = GetSpace(space.XPos, space.YPos + 3);
            }

            if (upWin)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos, space.YPos - 1);
                _winningSpots[2] = GetSpace(space.XPos, space.YPos - 2);
                _winningSpots[3] = GetSpace(space.XPos, space.YPos - 3);
            }

            if (upWin || downWin)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        // Checks for the following pattern horizontally "XXX-"
        bool OpenHorizontalCheck(BoardSpace space)
        {
            bool rightWin = false;
            bool leftWin = false;
            if (GetSpace(space.XPos + 1, space.YPos).SpaceColor == space.SpaceColor && GetSpace(space.XPos + 2, space.YPos).SpaceColor == space.SpaceColor &&
                GetSpace(space.XPos + 3, space.YPos).SpaceColor == "-")
            {
                rightWin = true;
            }
            if (GetSpace(space.XPos - 1, space.YPos).SpaceColor == space.SpaceColor && GetSpace(space.XPos - 2, space.YPos).SpaceColor == space.SpaceColor &&
                GetSpace(space.XPos - 3, space.YPos).SpaceColor == "-")
            {
                leftWin = true;
            }

            if (rightWin)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos + 1, space.YPos);
                _winningSpots[2] = GetSpace(space.XPos + 2, space.YPos);
                _winningSpots[3] = GetSpace(space.XPos + 3, space.YPos);
            }

            if (leftWin)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos - 1, space.YPos);
                _winningSpots[2] = GetSpace(space.XPos - 2, space.YPos);
                _winningSpots[3] = GetSpace(space.XPos - 3, space.YPos);
            }

            if (rightWin || leftWin)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        // Checks for the following pattern diagonally "XXX-"
        bool OpenDiagonalCheck(BoardSpace space)
        {
            bool upRightCheck = false, upLeftCheck = false, downRightCheck = false, downLeftCheck = false;

            if (GetSpace(space.XPos + 1, space.YPos + 1).SpaceColor == space.SpaceColor && GetSpace(space.XPos + 2, space.YPos + 2).SpaceColor == space.SpaceColor &&
                GetSpace(space.XPos + 3, space.YPos + 3).SpaceColor == "-")
            {
                upRightCheck = true;
            }

            if (GetSpace(space.XPos - 1, space.YPos + 1).SpaceColor == space.SpaceColor && GetSpace(space.XPos - 2, space.YPos + 2).SpaceColor == space.SpaceColor &&
                GetSpace(space.XPos - 3, space.YPos + 3).SpaceColor == "-")
            {
                upLeftCheck = true;
            }

            if (GetSpace(space.XPos + 1, space.YPos - 1).SpaceColor == space.SpaceColor && GetSpace(space.XPos + 2, space.YPos - 2).SpaceColor == space.SpaceColor &&
                GetSpace(space.XPos + 3, space.YPos - 3).SpaceColor == "-")
            {
                downRightCheck = true;
            }

            if (GetSpace(space.XPos - 1, space.YPos - 1).SpaceColor == space.SpaceColor && GetSpace(space.XPos - 2, space.YPos - 2).SpaceColor == space.SpaceColor &&
                GetSpace(space.XPos - 3, space.YPos - 3).SpaceColor == "-")
            {
                downLeftCheck = true;
            }

            if (upRightCheck)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos + 1, space.YPos + 1);
                _winningSpots[2] = GetSpace(space.XPos + 2, space.YPos + 2);
                _winningSpots[3] = GetSpace(space.XPos + 3, space.YPos + 3);
            }
            else if (upLeftCheck)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos - 1, space.YPos + 1);
                _winningSpots[2] = GetSpace(space.XPos - 2, space.YPos + 2);
                _winningSpots[3] = GetSpace(space.XPos - 3, space.YPos + 3);
            }
            else if (downRightCheck)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos + 1, space.YPos - 1);
                _winningSpots[2] = GetSpace(space.XPos + 2, space.YPos - 2);
                _winningSpots[3] = GetSpace(space.XPos + 3, space.YPos - 3);
            }
            else if (downLeftCheck)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos - 1, space.YPos - 1);
                _winningSpots[2] = GetSpace(space.XPos - 2, space.YPos - 2);
                _winningSpots[3] = GetSpace(space.XPos - 3, space.YPos - 3);
            }

            if (upLeftCheck || upRightCheck || downLeftCheck || downRightCheck)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        // Checks for the following pattern horizontally "XXXX"
        bool HorizontalCheck(BoardSpace space)
        {
            bool win = true;
            for (int i = 1; i < 4; i++)
            {
                if (GetSpace(space.XPos + i, space.YPos).SpaceColor != space.SpaceColor)
                {
                    win = false;
                }
            }

            if (win)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos + 1, space.YPos);
                _winningSpots[2] = GetSpace(space.XPos + 2, space.YPos);
                _winningSpots[3] = GetSpace(space.XPos + 3, space.YPos);
            }

            return win;
        }
        // Checks for the following pattern diagonally "XXXX"
        bool DiagonalCheck(BoardSpace space)
        {
            bool upRightCheck = true, upLeftCheck = true, downRightCheck= true, downLeftCheck = true;

            for (int i = 1; i < 4; i++)
            {
                if (GetSpace(space.XPos + i, space.YPos + i).SpaceColor != space.SpaceColor)
                {
                    upRightCheck = false;
                }

                if (GetSpace(space.XPos - i, space.XPos - i).SpaceColor != space.SpaceColor)
                {
                    downLeftCheck = false;
                }

                if (GetSpace(space.XPos + i, space.YPos - i).SpaceColor != space.SpaceColor)
                {
                    downRightCheck = false;
                }

                if (GetSpace(space.XPos - i, space.YPos + i).SpaceColor != space.SpaceColor)
                {
                    upLeftCheck = false;
                }
            }

            if (upRightCheck)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos + 1, space.YPos + 1);
                _winningSpots[2] = GetSpace(space.XPos + 2, space.YPos + 2);
                _winningSpots[3] = GetSpace(space.XPos + 3, space.YPos + 3);
            }
            else if (upLeftCheck)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos - 1, space.YPos + 1);
                _winningSpots[2] = GetSpace(space.XPos - 2, space.YPos + 2);
                _winningSpots[3] = GetSpace(space.XPos - 3, space.YPos + 3);
            }
            else if (downRightCheck)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos + 1, space.YPos - 1);
                _winningSpots[2] = GetSpace(space.XPos + 2, space.YPos - 2);
                _winningSpots[3] = GetSpace(space.XPos + 3, space.YPos - 3);
            }
            else if (downLeftCheck)
            {
                _winningSpots[0] = space;
                _winningSpots[1] = GetSpace(space.XPos - 1, space.YPos - 1);
                _winningSpots[2] = GetSpace(space.XPos - 2, space.YPos - 2);
                _winningSpots[3] = GetSpace(space.XPos - 3, space.YPos - 3);
            }

            if (upLeftCheck || upRightCheck || downLeftCheck || downRightCheck)
            {
                return true;
            }
            else
            {
                return false;
            }
        }