Ejemplo n.º 1
0
        // Token: 0x06002558 RID: 9560 RVA: 0x000B9930 File Offset: 0x000B7B30
        public virtual int GrabListThreadSafe(FastList <T> threadList, bool fastClear = false)
        {
            int result;

            lock (threadList)
            {
                int count = this._count;
                this.AddRange(threadList);
                if (fastClear)
                {
                    threadList.FastClear();
                }
                else
                {
                    threadList.Clear();
                }
                result = count;
            }
            return(result);
        }
Ejemplo n.º 2
0
        public void GetSectors(FastList <Sector3D <T> > list, Vector3 pos, float radius)
        {
            list.FastClear();

            Int3 startSector = GetSectorIndex(new Vector3(pos.x - radius, pos.y - radius, pos.z - radius));
            Int3 endSector   = GetSectorIndex(new Vector3(pos.x + radius, pos.y + radius, pos.z + radius));

            for (int z = startSector.z; z < endSector.z; z++)
            {
                for (int y = startSector.y; y <= endSector.y; y++)
                {
                    for (int x = startSector.x; x <= endSector.x; x++)
                    {
                        if (sectors[x, y, z] == null)
                        {
                            continue;
                        }

                        list.Add(sectors[x, y, z]);
                    }
                }
            }
        }