/**/ public Chess Move(string move) { FigureMoving fm = new FigureMoving(move); if (!moves.CanMove(fm)) { return(this); } if (board.IsCheckAfterMove(fm)) { return(this); } Board nextboard = board.Move(fm); Chess nextChess = new Chess(nextboard); return(nextChess); }
bool CanEatKing() { Square badKing = FindBadKing(); Moves moves = new Moves(this); foreach (FigureOnSquare fs in YieldFigures()) { FigureMoving fm = new FigureMoving(fs, badKing); if (moves.CanMove(fm)) { return(true); } } return(false); }