Example #1
0
        public bool Dealloc(GenIdx index)
        {
            var entry = Entries[index.Index];

            if (entry.Generation != index.Generation || !entry.Alive)
            {
                return(false);
            }
            Free.Push(index.Index);
            entry.Alive = false;
            return(true);
        }
Example #2
0
 public T? this[GenIdx idx]
 {
     get => Allocator.Alive(idx) ? Backing[idx.Index].Value : default(T?);
Example #3
0
        public bool Alive(GenIdx index)
        {
            var entry = Entries[index.Index];

            return(entry.Alive && entry.Generation == index.Generation);
        }