public static void Recycle <T, TCopy>(ref HashSetCopyable <T> list, TCopy copy) where TCopy : IArrayElementCopy <T> { if (list != null) { foreach (var item in list) { copy.Recycle(item); } PoolHashSetCopyable <T> .Recycle(ref list); } }
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 static void Copy <T>(HashSetCopyable <T> fromArr, ref HashSetCopyable <T> arr) where T : struct { if (fromArr == null) { if (arr != null) { PoolHashSetCopyable <T> .Recycle(ref arr); } arr = null; return; } if (arr == null) { arr = PoolHashSetCopyable <T> .Spawn(fromArr.Count); } arr.CopyFrom(fromArr); }
public static void Copy <T, TCopy>(HashSetCopyable <T> fromArr, ref HashSetCopyable <T> arr, TCopy copy) where T : struct where TCopy : IArrayElementCopy <T> { if (fromArr == null) { if (arr != null) { arr.Clear(copy); PoolHashSetCopyable <T> .Recycle(ref arr); } arr = null; return; } if (arr == null) { arr = PoolHashSetCopyable <T> .Spawn(); } arr.CopyFrom(fromArr, copy); }
public void CopyFrom(Filter <TState, TEntity> other) { this.id = other.id; this.name = other.name; this.nodesCount = other.nodesCount; ArrayUtils.Copy(other.nodes, ref this.nodes); if (this.data != null) { PoolHashSetCopyable <Entity> .Recycle(ref this.data); } this.data = PoolHashSetCopyable <Entity> .Spawn(other.data.Count); this.data.CopyFrom(other.data); if (this.dataContains != null) { PoolHashSetCopyable <EntityId> .Recycle(ref this.dataContains); } this.dataContains = PoolHashSetCopyable <EntityId> .Spawn(other.dataContains.Count); this.dataContains.CopyFrom(other.dataContains); }
public void DeInitialize() { PoolListCopyable <GlobalEventFrameItem> .Recycle(ref this.globalEventLogicItems); PoolHashSetCopyable <long> .Recycle(ref this.globalEventLogicEvents); }