public void Remove(Entity e)
        {
            activeEntities.Set(e.GetId(), null);

            e.SetTypeBits(0);

            Refresh(e);

            RemoveComponentsOfEntity(e);

            count--;
            totalRemoved++;

            removedAndAvailable.Add(e);
            if (RemovedEntityEvent != null)
            {
                RemovedEntityEvent(e);
            }
        }