public QuadTree( RectangleF boundary, int threshold, bool allowOverflow, ListArray <Item> items, Func <ListArray <Item> > getListFunc) { Boundary = boundary; Threshold = threshold; AllowOverflow = allowOverflow; _getListFunc = getListFunc ?? throw new ArgumentNullException(nameof(getListFunc)); Items = items; }
public PooledQuadTree(RectangleF boundary, int threshold, bool allowOverflow) { _pool = new ListArray <ListArray <QuadTree <T> .Item> >(); CurrentTree = new QuadTree <T>(boundary, threshold, allowOverflow, GetList); }
internal QuadTree(RectangleF bounds, int threshold, bool allowOverflow, bool fuzzyBoundaries) { Items = new ListArray <QuadTreeItem <T> >(threshold); Set(bounds, threshold, allowOverflow, fuzzyBoundaries); }
public QuadTree( float x, float y, float width, float height, int threshold, bool allowOverflow, ListArray <Item> existingList) : this(new RectangleF(x, y, width, height), threshold, allowOverflow, existingList) { }
public QuadTree( RectangleF boundary, int threshold, bool allowOverflow, ListArray <Item> existingList) : this(boundary, threshold, allowOverflow, existingList, () => DefaultGetList(threshold)) { }
public static void Return(ListArray <QuadTreeItem <T> > list) { // clear as it may contain reference-types list.Clear(); _listPool.Add(list); }