public Chess Move(string move) // Figure_name + start position + end position { 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 enemyKing = FindEnemyKing(); Moves moves = new Moves(this); foreach (FigureOnSquare fs in YieldFigures()) { FigureMoving fm = new FigureMoving(fs, enemyKing); if (moves.canMove(fm)) { return(true); } } return(false); }