示例#1
0
        internal bool IsMoveMakeCheck(Location target)
        {
            var boardCopy       = board.GetBoardCopy();
            var gameBoard       = board.GetBoard();
            var temp_source_pos = new Location();

            temp_source_pos.x                      = location.x;
            temp_source_pos.y                      = location.y;
            gameBoard[target.x][target.y]          = gameBoard[location.x][location.y];
            gameBoard[location.x][location.y]      = null;
            gameBoard[target.x][target.y].location = target;
            var isInCheck = IsInCheck();

            gameBoard[target.x][target.y] = null;
            gameBoard[temp_source_pos.x][temp_source_pos.y]          = boardCopy[temp_source_pos.x][temp_source_pos.y];
            gameBoard[temp_source_pos.x][temp_source_pos.y].location = temp_source_pos;
            gameBoard[target.x][target.y] = boardCopy[target.x][target.y];
            if (isInCheck)
            {
                return(true);
            }
            return(false);
        }
示例#2
0
 internal ChessPiece[][] GetBoard()
 {
     return(board.GetBoard());
 }