public EiLLNode(T value) { this.Value = value; Next = null; Prev = null; List = null; }
protected void SubscribeFixedUpdate() { if (fixedUpdateNode == null) { fixedUpdateNode = EiUpdateSystem.Instance.SubscribeFixedUpdate(this); } }
public void ClearFast() { lock (this) { node = null; count = 0; } }
public void Remove(EiLLNode <T> node) { lock (this) { if (node.List != this) { return; } if (node == this.node) { this.node = node.Next; } node.Prev.Next = node.Next; node.Next.Prev = node.Prev; node.Prev = null; node.Next = null; node.List = null; nodes.Enqueue(node); if (count <= 1) { this.node = null; } count--; } }
public void Move(EiLLNode <T> node, EiLinkedList <T> otherList) { if (node.List != this) { throw new Exception("You are not allowed to move nodes from other list without going through its own list"); } if (count == 1) { this.node = null; } node.Prev.Next = node.Next; node.Next.Prev = node.Prev; node.List = otherList; if (otherList.Count() == 0) { node.Next = node; node.Prev = node; otherList.node = node; } else { otherList.node.Prev.Next = node; node.Prev = otherList.node.Prev; node.Next = otherList.node; otherList.node.Prev = node; } count--; otherList.count++; }
protected void SubscribeThreadedUpdate() { if (threadedUpdateNode == null) { threadedUpdateNode = EiThreadedUpdateSystem.Instance.Subscribe(this); } }
public EiLLNode <T> Add(T value) { lock (this) { EiLLNode <T> node; if (!nodes.TryDequeue(out node)) { node = new EiLLNode <T> (value); } else { node.Value = value; } if (count == 0) { this.node = node; node.Next = this.node; node.Prev = this.node; } else { node.Prev = this.node.Prev; node.Next = this.node; this.node.Prev.Next = node; this.node.Prev = node; } count++; node.List = this; return(node); } }
protected void SubscribeLateUpdate() { if (lateUpdateNode == null) { lateUpdateNode = EiUpdateSystem.Instance.SubscribeLateUpdate(this); } }
protected void UnsubscribeFixedUpdate() { if (fixedUpdateNode != null) { EiUpdateSystem.Instance.UnsubscribeFixedUpdate(fixedUpdateNode); } fixedUpdateNode = null; }
protected void UnsubscribeLateUpdate() { if (lateUpdateNode != null) { EiUpdateSystem.Instance.UnsubscribeLateUpdate(lateUpdateNode); } lateUpdateNode = null; }
protected void UnsubscribeThreadedUpdate() { if (threadedUpdateNode != null) { EiThreadedUpdateSystem.Instance.Unsubscribe(threadedUpdateNode); } threadedUpdateNode = null; }
protected void UnsubscribePreUpdate() { if (preUpdateNode != null) { EiUpdateSystem.Instance.UnsubscribePreUpdate(preUpdateNode); } preUpdateNode = null; }
public void Unsubscribe(EiLLNode <EiUpdateInterface> node) { if (node.List != null) { node.List.Remove(node); } else { LogError(() => "Cant remove node from system"); } }
public void Unsubscribe(EiLLNode <EiUpdateInterface> node) { if (node.List != null) { node.List.Remove(node); } else { UnityEngine.Debug.LogError("Cant remove node from system"); } }
public EiLLNode <T>[] AddRange(T[] values) { lock (this) { EiLLNode <T>[] nodes = new EiLLNode <T> [values.Length]; for (int i = 0; i < values.Length; i++) { nodes [i] = Add(values [i]); } return(nodes); } }
/// <summary> /// Remove the specified node object, very slow. /// Will iterate through object until it finds object, then delete it. /// </summary> /// <param name="obj">Object.</param> public void Remove(T nodeObject) { lock (this) { var iterator = GetIterator(); EiLLNode <T> node = null; while (iterator.Next(out node)) { if (node.Value == nodeObject) { Remove(node); return; } } } }
public bool Next(out T value) { if (current == null) { if (first == null) { value = default(T); return(false); } value = (current = first).Value; return(true); } value = (current = current.Next).Value; return(current != first); }
public void RemoveAfter(EiLLNode <T> node) { lock (this) { if (node.List != this) { return; } var nextNode = node.Next; while (nextNode != this.node) { var toRemove = nextNode; nextNode = nextNode.Next; Remove(toRemove); } } }
public bool Next(out EiLLNode <T> node) { if (current == null) { if (first == null) { node = null; return(false); } node = current = first; return(node != null); } node = (current = current.Next); return(current != first && node != null); }
public void RemoveBefore(EiLLNode <T> node) { lock (this) { if (node.List != this) { return; } var nextNode = node.Prev; while (nextNode != this.node) { var toRemove = nextNode; nextNode = nextNode.Prev; Remove(toRemove); } } }
public void DestroyCurrent() { var cur = current; if (first == current) { first = current.Next; current = null; } else { current = current.Prev; } if (cur != null && cur.List != null) { cur.List.Remove(cur); } }
public void Unsubscribe(EiLLNode <EiUpdateInterface> node) { components.Remove(node); }
public EiLLIterator(EiLLNode <T> first) { this.first = first; current = null; }
public void SetNode(EiLLNode <ThreadContainer> node) { this.node = node; }
protected void UnsubscribeUpdateTimer(EiLLNode <EiUpdateSystem.TimerUpdateData> node) { EiUpdateSystem.Instance.UnsubscribeTimerUpdate(node); }
public static void Unsubscribe <T> (EiLLNode <MessageSubscriber <T> > component) { Message <T> .subscribers.Remove(component); }
public void ShiftNext() { lock (this) { node = node.Next; } }
public void ShiftBack() { lock (this) { node = node.Prev; } }
protected void Unsubscribe <T> (EiLLNode <EiMessageSubscriber <T> > subscriber) { EiMessage.Unsubscribe(subscriber); }
public void UnsubscribeFixedUpdate(EiLLNode <EiUpdateInterface> component) { fixedUpdateList.Remove(component); }