public static void Recycle <TComponent>(HashSet <TComponent> list) where TComponent : class, IComponentBase { foreach (var item in list) { PoolComponents.Recycle(item); } list.Clear(); }
public static void Recycle <TComponent>(ME.ECS.Collections.ListCopyable <TComponent> list) where TComponent : class, IComponentBase { for (int i = 0; i < list.Count; ++i) { PoolComponents.Recycle(list[i], list[i].GetType()); } list.Clear(); }
public static void Recycle <TComponent>(IList <TComponent> list) where TComponent : class, IComponentBase { for (int i = 0; i < list.Count; ++i) { PoolComponents.Recycle(list[i], list[i].GetType()); } list.Clear(); }
public static void Recycle <TComponent>(ref TComponent[] list) where TComponent : class, IComponentBase { for (int i = 0; i < list.Length; ++i) { PoolComponents.Recycle(list[i]); } PoolArray <TComponent> .Recycle(ref list); }
public void RemoveAll(Entity entity) { List <IComponent <TState, TEntity> > list; if (this.dic.TryGetValue(entity.id, out list) == true) { PoolComponents.Recycle(list); list.Clear(); } }
void IPoolableRecycle.OnRecycle() { foreach (var item in this.dic) { PoolComponents.Recycle(item.Value); PoolList <IComponent <TState, TEntity> > .Recycle(item.Value); } PoolDictionary <EntityId, List <IComponent <TState, TEntity> > > .Recycle(ref this.dic); this.freeze = false; this.capacity = 0; }
public void RemoveAll <TComponent>() where TComponent : class, IComponentBase { foreach (var item in this.dic) { var list = item.Value; for (int i = 0; i < list.Count; ++i) { var listItem = list[i]; if (listItem is TComponent listItemComponent) { PoolComponents.Recycle(listItemComponent); list.RemoveAt(i); --i; } } } }
public static void Recycle <T>(ref T system) where T : class, IComponentBase { PoolComponents.Recycle(system); system = null; }