internal GetSectorsFromBoundsEnumerator(SpatialPartition <TSector> sectors, SectorIndex tl_, SectorIndex br_, bool create) { tl = tl_; br = br_; item = new SectorIndex(); this.create = create; this.sectors = sectors; x = tl_.First - 1; y = tl_.Second; current = null; }
public ItemBoundsEnumerator(SpatialCollection <T> collection, SectorIndex tl, SectorIndex br, bool allowDuplicates) { _Collection = collection; _Sectors = new SpatialPartition <Sector> .GetSectorsFromBoundsEnumerator(collection._Partition, tl, br, false); _Sector = null; _Current = null; _SectorEnumerator = default(HashSet <ItemInfo> .Enumerator); _AllowDuplicates = allowDuplicates; if (!allowDuplicates) { _SeenList = SpatialCollection <T> .GetSeenList(); } else { _SeenList = null; } }
internal GetSectorsFromBoundsEnumerator(SpatialPartition <TSector> sectors, Bounds bounds, bool create) : this(sectors, sectors.GetIndexFromPoint(bounds.TopLeft), sectors.GetIndexFromPoint(bounds.BottomRight), create) { }
public SpatialCollection(float subdivision) { _Partition = new SpatialPartition <Sector>(subdivision, (index) => new Sector(index, _ItemInfoComparer)); }
public SectorsEnumerable(SpatialPartition <TSector> partition) { Partition = partition; }