Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
        public PooledQuadTree(RectangleF boundary, int threshold, bool allowOverflow)
        {
            _pool = new ListArray <ListArray <QuadTree <T> .Item> >();

            CurrentTree = new QuadTree <T>(boundary, threshold, allowOverflow, GetList);
        }
Exemplo n.º 3
0
 internal QuadTree(RectangleF bounds, int threshold, bool allowOverflow, bool fuzzyBoundaries)
 {
     Items = new ListArray <QuadTreeItem <T> >(threshold);
     Set(bounds, threshold, allowOverflow, fuzzyBoundaries);
 }
Exemplo n.º 4
0
 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)
 {
 }
Exemplo n.º 5
0
 public QuadTree(
     RectangleF boundary, int threshold, bool allowOverflow, ListArray <Item> existingList) :
     this(boundary, threshold, allowOverflow, existingList, () => DefaultGetList(threshold))
 {
 }
Exemplo n.º 6
0
 public static void Return(ListArray <QuadTreeItem <T> > list)
 {
     // clear as it may contain reference-types
     list.Clear();
     _listPool.Add(list);
 }