public IEnumerable <FigureOnSquare> YieldFiguresOnSquares() { foreach (Square square in Square.YeildBoardSquares()) { if (GetFigureAt(square).GetFigureColor() == MoveColor) { yield return(new FigureOnSquare(GetFigureAt(square), square)); } } }
public List <FigureOnSquare> GetFigureOnSquares() { var figuresOnSquares = new List <FigureOnSquare>(); foreach (Square square in Square.YeildBoardSquares()) { if (GetFigureAt(square).GetFigureColor() == MoveColor) { figuresOnSquares.Add(new FigureOnSquare(GetFigureAt(square), square)); } } return(figuresOnSquares); }