public override void Recycle() { this.anchorPosition = default; this.rotation = default; this.scale = default; PoolClass <RectState> .Recycle(this); }
public static void Release(ref FiltersStorage storage) { if (storage == null) { return; } PoolClass <FiltersStorage> .Recycle(ref storage); }
public static void ReleaseState <TState>(ref State state) where TState : State, new() { state.entityId = default; state.tick = default; state.randomState = default; PoolClass <TState> .Recycle((TState)state); state = null; }
public override void RemoveNode(ref Node node, bool bruteForceConnections = false) { base.RemoveNode(ref node, bruteForceConnections); var g = (GridNode)node; PoolClass <GridNode> .Recycle(ref g); node = null; }
public void Dispose() { this.internalCall = default; this.animationComplete = default; this.hierarchyComplete = default; this.baseComplete = default; this.instance = null; this.parameters = default; PoolClass <ShowHideClosureParametersClass> .Recycle(this); }
public static string UnpackDirect(Packer packer) { var length = Int32Serializer.UnpackDirect(packer); var sb = PoolClass <System.Text.StringBuilder> .Spawn(); sb.Clear(); sb.Capacity = length; for (int i = 0; i < length; ++i) { sb.Append(CharSerializer.UnpackDirect(packer)); } var res = sb.ToString(); PoolClass <System.Text.StringBuilder> .Recycle(ref sb); return(res); }
/// <summary> /// Local helper function to Pop an item from the stack, slow path /// </summary> /// <param name="result">The popped item</param> /// <returns>True if succeeded, false otherwise</returns> private bool TryPopCore(out T result) { Node poppedNode; if (TryPopCore(1, out poppedNode) == 1) { result = poppedNode.m_value; if (this.usePool == true) { PoolClass <Node> .Recycle(ref poppedNode); } return(true); } result = default(T); return(false); }
public static void ReleaseWorld <TState>(ref World world) where TState : State, new() { if (world == null || world.isActive == false) { world = null; return; } Worlds.DeInitializeBegin(); var w = world; world.RecycleResetState <TState>(); PoolClass <World> .Recycle(ref w); world.RecycleStates <TState>(); Worlds.UnRegister(world); Worlds.DeInitializeEnd(); }
/// <summary> /// Removes all objects from the <see cref="ConcurrentStack{T}"/>. /// </summary> public void Clear() { // Clear the list by setting the head to null. We don't need to use an atomic // operation for this: anybody who is mutating the head by pushing or popping // will need to use an atomic operation to guarantee they serialize and don't // overwrite our setting of the head to null. var current = this.m_head; this.m_head = null; if (this.usePool == true) { while (current != null) { PoolClass <Node> .Recycle(ref current); current = current.m_next; } } }
/// <summary> /// Attempts to pop and return the object at the top of the <see cref="ConcurrentStack{T}"/>. /// </summary> /// <param name="result"> /// When this method returns, if the operation was successful, <paramref name="result"/> contains the /// object removed. If no object was available to be removed, the value is unspecified. /// </param> /// <returns>true if an element was removed and returned from the top of the <see /// cref="ConcurrentStack{T}"/> /// succesfully; otherwise, false.</returns> public bool TryPop(out T result) { Node head = m_head; //stack is empty if (head == null) { result = default(T); return(false); } if (Interlocked.CompareExchange(ref m_head, head.m_next, head) == head) { result = head.m_value; if (this.usePool == true) { PoolClass <Node> .Recycle(ref head); } return(true); } // Fall through to the slow path. return(TryPopCore(out result)); }
public override void OnRecycle() { this.size = default; this.nodeSize = default; this.initialPenalty = default; this.diagonalCostFactor = default; this.connectionsType = default; this.agentHeight = default; this.checkMask = default; this.collisionMask = default; this.collisionCheckRadius = default; if (this.nodes != null) { Debug.Log("Recycle: " + this.nodes.Count); for (int i = 0; i < this.nodes.Count; ++i) { var node = (GridNode)this.nodes[i]; PoolClass <GridNode> .Recycle(ref node); } this.nodes.Clear(); } }
public void Destroy(IViewsProvider <TEntity> instance) { PoolClass <UnityGameObjectProvider <TEntity> > .Recycle((UnityGameObjectProvider <TEntity>) instance); }
public void Destroy(IViewsProvider instance) { PoolClass <NoViewProvider> .Recycle((NoViewProvider)instance); }
public static void Release(ref Components components) { PoolClass <Components> .Recycle(ref components); }
public static void Release(ref FiltersStorage storage) { PoolClass <FiltersStorage> .Recycle(ref storage); }
public static void Release(ref Storage storage) { PoolClass <Storage> .Recycle(ref storage); }
public void Recycle(Node item) { var g = (GridNode)item; PoolClass <GridNode> .Recycle(ref g); }
public static void ReleaseWorld <TState>(ref World <TState> world) where TState : class, IState <TState>, new() { Worlds <TState> .UnRegister(world); PoolClass <World <TState> > .Recycle(ref world); }
public static void Release <TEntity, TState>(ref Components <TEntity, TState> components) where TState : class, IState <TState>, new() where TEntity : struct, IEntity { PoolClass <Components <TEntity, TState> > .Recycle(ref components); }
public static void Release <T>(ref Storage <T> storage) where T : struct, IEntity { PoolClass <Storage <T> > .Recycle(ref storage); }
public void Destroy(IViewsProvider <TEntity> instance) { PoolClass <NoViewProvider <TEntity> > .Recycle((NoViewProvider <TEntity>) instance); }
public void Destroy(IViewsProvider instance) { PoolClass <UnityGameObjectProvider> .Recycle((UnityGameObjectProvider)instance); }
public static void ReleaseState <TState>(ref TState state) where TState : class, IStateBase, new() { state.entityId = default; state.tick = default; PoolClass <TState> .Recycle(ref state); }
public override void Recycle() { this.alpha = default; PoolClass <AlphaState> .Recycle(this); }