public IEnumerable <string> YieldValidMoves() { foreach (FigureOnSquare fs in board.YieldMyFigureSquares()) { foreach (Square to in Square.YieldBoardSquares()) { foreach (Figure promotion in fs.figure.YieldPromotions(to)) { FigureMoving fm = new FigureMoving(fs, to, promotion); if (moves.CanMove(fm)) { if (!board.IsCheckAfter(fm)) { yield return(fm.ToString()); } } } } } }