public static void Copy <T, TCopy>(ME.ECS.Collections.BufferArray <T> fromArr, ref ME.ECS.Collections.BufferArray <T> arr, TCopy copy) where TCopy : IArrayElementCopy <T> { if (fromArr.arr == null) { if (arr.arr != null) { for (int i = 0; i < arr.Length; ++i) { copy.Recycle(arr.arr[i]); } PoolArray <T> .Recycle(ref arr); } arr = BufferArray <T> .Empty; return; } if (arr.arr == null || fromArr.Length != arr.Length) { if (arr.arr != null) { PoolArray <T> .Recycle(ref arr); } arr = PoolArray <T> .Spawn(fromArr.Length); } for (int i = 0; i < fromArr.Length; ++i) { copy.Copy(fromArr.arr[i], ref arr.arr[i]); } }
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 static void Recycle <T, TCopy>(ref ME.ECS.Collections.BufferArray <T> item, TCopy copy) where TCopy : IArrayElementCopy <T> { for (int i = 0; i < item.Length; ++i) { copy.Recycle(item.arr[i]); } PoolArray <T> .Recycle(ref item); }
public static void Recycle <T, TCopy>(ref T[] item, TCopy copy) where TCopy : IArrayElementCopy <T> { if (item != null) { for (int i = 0; i < item.Length; ++i) { copy.Recycle(item[i]); } PoolArray <T> .Recycle(ref item); } }
void IPoolableRecycle.OnRecycle() { PoolHashSetCopyable <EntityId> .Recycle(ref this.dataContains); PoolHashSetCopyable <Entity> .Recycle(ref this.data); PoolArray <IFilterNode> .Recycle(ref this.nodes); PoolHashSet <Entity> .Recycle(ref this.requestsRemoveEntity); PoolHashSet <Entity> .Recycle(ref this.requests); }
public void Dispose() { for (int i = 0; i < this.itemsContains.Length; ++i) { this.itemsContains.arr[i].Dispose(); } PoolArray <Item> .Recycle(ref this.itemsContains); for (int i = 0; i < this.itemsNotContains.Length; ++i) { this.itemsNotContains.arr[i].Dispose(); } PoolArray <Item> .Recycle(ref this.itemsNotContains); }
internal void Deconstruct() { for (int i = 0; i < this.systems.Count; ++i) { this.systems.arr[i].OnDeconstruct(); if (this.systems.arr[i] is ISystemFilter systemFilter) { systemFilter.filter = null; } PoolSystems.Recycle(this.systems.arr[i]); } PoolArray <ISystemBase> .Recycle(ref this.systems); PoolArray <ModuleState> .Recycle(ref this.statesSystems); }
public static void Copy <T, TCopy>(T[] fromArr, ref T[] arr, TCopy copy) where TCopy : IArrayElementCopy <T> { if (fromArr == null) { if (arr != null) { for (int i = 0; i < arr.Length; ++i) { copy.Recycle(arr[i]); } PoolArray <T> .Recycle(ref arr); } arr = null; return; } if (arr == null || fromArr.Length != arr.Length) { if (arr != null) { ArrayUtils.Recycle(ref arr, copy); } arr = new T[fromArr.Length]; } var cnt = arr.Length; for (int i = 0; i < fromArr.Length; ++i) { var isDefault = i >= cnt; T item = (isDefault ? default : arr[i]); copy.Copy(fromArr[i], ref item); arr[i] = item; } }
public void OnRecycle() { PoolArray <Archetype> .Recycle(ref this.prevTypes); PoolArray <Archetype> .Recycle(ref this.types); }
public void Recycle() { PoolArray <ushort> .Recycle(ref this.values); }
public void Dispose() { PoolArray <int> .Recycle(ref this.filters); }
public void OnRecycle() { PoolArray <uint> .Recycle(ref this.values); }
partial void OnRecycleComponents() { PoolArray <IComponents <TState> > .Recycle(ref this.componentsCache); //PoolDictionary<int, IComponents<TState>>.Recycle(ref this.componentsCache); }