public void Process() { CollisionObserver pNode = this.head; while (pNode != null) { // Fire off listener pNode.ExecuteDelayed(); pNode = (CollisionObserver)pNode.GetNext(); } // remove pNode = this.head; CollisionObserver pTmp = null; while (pNode != null) { pTmp = pNode; pNode = (CollisionObserver)pNode.GetNext(); // remove this.PrivDetach(pTmp, ref this.head); } }
static public void Process() { DelayedObjectMan pDelayMan = DelayedObjectMan.PrivGetInstance(); CollisionObserver pNode = pDelayMan.head; while (pNode != null) { // Fire off listener pNode.execute(); pNode = (CollisionObserver)pNode.pNext; } // remove pNode = pDelayMan.head; CollisionObserver pTmp = null; while (pNode != null) { pTmp = pNode; pNode = (CollisionObserver)pNode.pNext; // remove pDelayMan.PrivDetach(pTmp, ref pDelayMan.head); } }
public void NotifyObservers() { CollisionObserver curr = this.pObservers; while (curr != null) { curr.Update(); curr = (CollisionObserver)curr.pONext; } }
public void notify() { CollisionObserver pNode = this.pHead; while (pNode != null) { pNode.notify(); pNode = (CollisionObserver)pNode.pNext; } }
public void Notify() { CollisionObserver pNode = this.pHead; while (pNode != null) { // Fire off listener pNode.Notify(); pNode = (CollisionObserver)pNode.pNext; } }
public void notify() { CollisionObserver colObserver = this.observerRoot; Debug.Assert(colObserver != null); while (colObserver != null) { colObserver.notify(); colObserver = (CollisionObserver)colObserver.pNext; } }
public void addObserver(CollisionObserver colObserver) { if (headObservers == null) { headObservers = new ObserverData(colObserver); } else { OLink temp = new ObserverData(colObserver); temp.next = headObservers; headObservers = temp; } }
public void attachObserver(CollisionObserver mObserver) { Debug.Assert(mObserver != null); if (observerRoot == null) { observerRoot = mObserver; observerRoot.pPrev = null; observerRoot.pNext = null; } else { mObserver.pNext = observerRoot; observerRoot.pPrev = observerRoot; observerRoot = mObserver; } }
public void RegisterObserver(CollisionObserver observer) { Debug.Assert(observer != null); observer.pSubject = this; if (this.pObservers == null) { this.pObservers = observer; observer.pONext = null; observer.pOPrev = null; } else { observer.pONext = pObservers; this.pObservers.pOPrev = observer; this.pObservers = observer; } }
private void Detach(CollisionObserver observer, ref CollisionObserver coNode) { Debug.Assert(observer != null); if (observer.pOPrev != null) { observer.pOPrev.pONext = observer.pONext; } else { coNode = (CollisionObserver)observer.pONext; } if (observer.pONext != null) { observer.pONext.pOPrev = observer.pOPrev; } }
private void PrivDetach(CollisionObserver node, ref CollisionObserver head) { // protection Debug.Assert(node != null); if (node.pPrev != null) { // middle or last node node.pPrev.pNext = node.pNext; } else { // first head = (CollisionObserver)node.pNext; } if (node.pNext != null) { // middle node node.pNext.pPrev = node.pPrev; } }
private void PrivDetach(CollisionObserver node, ref CollisionObserver head) { // protection Debug.Assert(node != null); if (node.GetPrev() != null) { // middle or last node node.GetPrev().SetNext(node.GetNext()); } else { // first head = (CollisionObserver)node.GetNext(); } if (node.GetNext() != null) { // middle node node.GetNext().SetPrev(node.GetPrev()); } }
public static void Attach(CollisionObserver observer) { Debug.Assert(observer != null); DelayedGameObjectManager delayedGOMan = DelayedGameObjectManager.GetInstance(); if (delayedGOMan.collisionObservers == null) { delayedGOMan.collisionObservers = observer; observer.pONext = null; observer.pOPrev = null; } else { observer.pONext = delayedGOMan.collisionObservers; observer.pOPrev = null; delayedGOMan.collisionObservers.pOPrev = observer; delayedGOMan.collisionObservers = observer; } }
//------------------------------------------------------------------------------- // Methods //------------------------------------------------------------------------------- public void attach(CollisionObserver observer) { Debug.Assert(observer != null); observer.pSubject = this; // add to front if (pHead == null) { pHead = observer; observer.pNext = null; observer.pPrev = null; } else { observer.pNext = pHead; pHead.pPrev = observer; pHead = observer; } }
public void Attach(CollisionObserver observer) { // protection Debug.Assert(observer != null); // add to front if (this.head == null) { this.head = observer; observer.SetNext(null); observer.SetPrev(null); } else { observer.SetNext(this.head); observer.SetPrev(null); this.head.SetPrev(observer); this.head = observer; } }
public static void Process() { DelayedGameObjectManager delayedGOMan = DelayedGameObjectManager.GetInstance(); CollisionObserver observer = delayedGOMan.collisionObservers; while (observer != null) { observer.Execute(); observer = (CollisionObserver)observer.pONext; } observer = delayedGOMan.collisionObservers; CollisionObserver obs = null; while (observer != null) { obs = observer; observer = (CollisionObserver)observer.pONext; delayedGOMan.Detach(obs, ref delayedGOMan.collisionObservers); } }
public void Attach(CollisionObserver observer) { // protection Debug.Assert(observer != null); observer.pSubject = this; // add to front if (pHead == null) { pHead = observer; observer.SetNext(null); observer.SetPrev(null); } else { observer.SetNext(pHead); pHead.SetPrev(observer); pHead = observer; } }
//--------------------------------------------------------------------------------------------------------- // Static methods //--------------------------------------------------------------------------------------------------------- static public void Attach(CollisionObserver observer) { // protection Debug.Assert(observer != null); DelayedObjectMan pDelayMan = DelayedObjectMan.PrivGetInstance(); // add to front if (pDelayMan.head == null) { pDelayMan.head = observer; observer.pNext = null; observer.pPrev = null; } else { observer.pNext = pDelayMan.head; observer.pPrev = null; pDelayMan.head.pPrev = observer; pDelayMan.head = observer; } }
public void Attach(CollisionObserver observer) { this.pSubject.Attach(observer); }
public CollisionSubject() { gameObjA = null; gameObjB = null; observerRoot = null; }
private DelayedGameObjectManager() { this.collisionObservers = null; }
public void RemoveObserver(CollisionObserver observer) { throw new NotImplementedException(); }
public DelayedObjectManager() { this.head = null; }
public CollisionSubject() { this.pObservers = null; this.goA = null; this.goB = null; }
public ObserverData(CollisionObserver collisionObserver) { this.collisionObserver = collisionObserver; }
private DelayedObjectManager() { this.head = null; }
public CollisionSubject() { this.pObjB = null; this.pObjA = null; this.pHead = null; }
public void attach(CollisionObserver observer) { this.poSubject.attach(observer); }
public void attach(CollisionObserver observer) { //Differently done observer.setColSubject(colSubject); this.colSubject.attachObserver(observer); }