Exemplo n.º 1
0
        private int Add(EntityInBuffer entityInBuffer)
        {
            if (this.capacity <= this.count)
            {
                // TODO: ...
            }


            int index = this.count++;

            this.entitiesInBuffer[index] = entityInBuffer;
            Array.Sort <EntityInBuffer>(this.entitiesInBuffer, 0, this.count);

            return(index);
        }
Exemplo n.º 2
0
        private int GetIndexOfEntityInBuffer(Entity entity)
        {
            var lookup = new EntityInBuffer(entity);

            return(Array.BinarySearch <EntityInBuffer>(this.entitiesInBuffer, 0, this.count, lookup));
        }