Пример #1
0
        public void AIPlace()
        {
            AI.Place();

            if (CheckGame.CheckWin(AI.AIRow, AI.AICol))
            {
                WinNotify?.Invoke(PlayingPlayer);
                return;
            }

            PlayingPlayer = (State)(3 - (int)PlayingPlayer); //Change player again
        }
Пример #2
0
        public bool Place(int Row, int Col)
        {
            if (ChessBoard[Row, Col] != State.Free)
            {
                Notify?.Invoke("You Cannot Place Here!");
                return(false);
            }

            ChessBoard[Row, Col] = PlayingPlayer;

            if (CheckGame.CheckWin(Row, Col))
            {
                WinNotify?.Invoke(PlayingPlayer);
                return(true);
            }

            PlayingPlayer = (State)(3 - (int)PlayingPlayer); //Change player

            return(true);
        }