Beispiel #1
0
        public bool MovePiece(Point from, Point to)
        {
            if (board.IsEmpty(from))
            {
                return(false);
            }
            if (king.IsEnemy(board[from]))
            {
                return(false);
            }

            Piece piece = board.PopPiece(from);

            if (IsCheck())
            {
                board.AddPiece(piece);
                return(false);
            }


            return(board.MovePiece(from, to));
        }