private IEnumerable <IsobarPoint> GetPoints(IsobarPoint first, IEnumerable <IsobarPoint>[][] vgrid, IEnumerable <IsobarPoint>[][] hgrid) { first.Parent = this; yield return(first); IsobarPoint next, current = first; while ((next = current.FindNext(vgrid, hgrid)) != null && next != first) { next.Parent = this; yield return(next); current = next; } }
public Isobar(IsobarPoint first, IEnumerable <IsobarPoint>[][] vgrid, IEnumerable <IsobarPoint>[][] hgrid, bool isClosed) { Value = first.Value; IsClosed = isClosed; Points = GetPoints(first, vgrid, hgrid).ToArray(); }