public override (Point pMin, Point pMax) ABBA() { if (entities.Count == 0) { return(base.ABBA()); } var result = entities[0].ABBA(); foreach (Entity entity in entities.Skip(1)) { var current = entity.ABBA(); result.pMax = Point.Max(current.pMax, result.pMax); result.pMin = Point.Min(current.pMin, result.pMin); } return(result); }
public virtual (Point pMin, Point pMax) ABBA() { var start = Points().FirstOrDefault(); return(Points().Aggregate((start, start), (abba, p) => (Point.Min(abba.Item1, p), Point.Max(abba.Item2, p)))); }