コード例 #1
0
 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;
 }
コード例 #2
0
            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;
                }
            }
コード例 #3
0
 internal GetSectorsFromBoundsEnumerator(SpatialPartition <TSector> sectors, Bounds bounds, bool create)
     : this(sectors, sectors.GetIndexFromPoint(bounds.TopLeft), sectors.GetIndexFromPoint(bounds.BottomRight), create)
 {
 }
コード例 #4
0
 public SpatialCollection(float subdivision)
 {
     _Partition = new SpatialPartition <Sector>(subdivision, (index) => new Sector(index, _ItemInfoComparer));
 }
コード例 #5
0
 public SectorsEnumerable(SpatialPartition <TSector> partition)
 {
     Partition = partition;
 }