public Chess Move(string move)// приймає хід в вигляді PE2E4 PE7E8 { FigureMoving fm = new FigureMoving(move); if (!moves.CanMove(fm)) { return(this); } if (board.IsCheckAfterMove(fm)) { return(this); } Board nextBoard = board.Move(fm); Chess nextCheess = new Chess(nextBoard); return(nextCheess); }
bool CanEatKing() { Square badKing = FindBadKing(); Moves moves = new Moves(this); foreach (FigureOnSqure fs in YeldFigures()) { FigureMoving fm = new FigureMoving(fs, badKing); if (moves.CanMove(fm)) { return(true); } } return(false); }