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;
            }
        }
Example #2
0
        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;
            }
        }