List <List <Figure> > IGrouping.Grouping(List <Figure> list) { List <List <Figure> > Array = new List <List <Figure> >(); List <Figure> arr; Heir.Sort(list); double Max = FiguresListGenerator.GetMax(list); double step = Max / Number; (double Min, double Max)pair = (0, step); while (pair.Max <= Max) { arr = new List <Figure>(); foreach (Figure fg in list) { if (fg.area() >= pair.Min && fg.area() <= pair.Max) { arr.Add(fg); } } Array.Add(arr); pair.Min += step; pair.Max += step; } return(Array); }
object IContentGenerator.GenerateContent() { return(group.Grouping(Figures).Zip(pairs.GetPairsList(FiguresListGenerator.GetMax(Figures)), (first, second) => new Tuple <List <Figure>, (double Min, double Max)>(first, second)) as object); }