コード例 #1
0
ファイル: InputSubject.cs プロジェクト: wangjo22/Final
        public void Notify()
        {
            InputObserver pNode = this.pHead;

            while (pNode != null)
            {
                pNode.Notify();
                pNode = (InputObserver)pNode.pNext;
            }
        }
コード例 #2
0
        public void NotifyObservers()
        {
            InputObserver curr = this.pObservers;

            while (curr != null)
            {
                curr.Update();
                curr = (InputObserver)curr.pONext;
            }
        }
コード例 #3
0
        public void Notify()
        {
            InputObserver pNode = this.head;

            while (pNode != null)
            {
                // Fire off listener
                pNode.Notify();

                pNode = (InputObserver)pNode.pNext;
            }
        }
コード例 #4
0
        public void notify()
        {
            InputObserver pNode = this.pHead;

            while (pNode != null)
            {
                // notify observers
                pNode.notify();

                pNode = (InputObserver)pNode.pNext;
            }
        }
コード例 #5
0
        public void Notify(float xCurs, float yCurs)
        {
            InputObserver pNode = this.head;

            while (pNode != null)
            {
                // Fire off listener
                pNode.Notify(xCurs, yCurs);

                pNode = (InputObserver)pNode.pNext;
            }
        }
コード例 #6
0
        public void attachObserver(InputObserver mObserver)
        {
            Debug.Assert(mObserver != null);

            if (observer == null)
            {
                observer       = mObserver;
                observer.pPrev = null;
                observer.pNext = null;
            }
            else
            {
                mObserver.pNext = observer;
                observer.pPrev  = observer;
                observer        = mObserver;
            }
        }
コード例 #7
0
        public void RegisterObserver(InputObserver observer)
        {
            Debug.Assert(observer != null);
            observer.pSubject = this;

            if (pObservers == null)
            {
                pObservers      = observer;
                observer.pONext = null;
                observer.pOPrev = null;
            }
            else
            {
                observer.pONext   = pObservers;
                pObservers.pOPrev = observer;
                pObservers        = observer;
            }
        }
コード例 #8
0
        //-------------------------------------------------------------------------------
        // Methods
        //-------------------------------------------------------------------------------
        public void attach(InputObserver observer)
        {
            Debug.Assert(observer != null);

            observer.pSubject = this;

            // add to front
            if (this.pHead == null)
            {
                this.pHead     = observer;
                observer.pPrev = null;
                observer.pNext = null;
            }
            else
            {
                observer.pPrev   = null;
                observer.pNext   = this.pHead;
                this.pHead.pPrev = observer;
                this.pHead       = observer;
            }
        }
コード例 #9
0
        public void Attach(InputObserver observer)
        {
            // protection
            Debug.Assert(observer != null);

            observer.pSubject = this;

            // add to front
            if (head == null)
            {
                head           = observer;
                observer.pNext = null;
                observer.pPrev = null;
            }
            else
            {
                observer.pNext = head;
                observer.pPrev = null;
                head.pPrev     = observer;
                head           = observer;
            }
        }
コード例 #10
0
        public void Attach(InputObserver observer)
        {
            // protection
            Debug.Assert(observer != null);

            observer.pSubject = this;

            // add to front
            if (head == null)
            {
                head = observer;
                observer.SetNext(null);
                observer.SetPrev(null);
            }
            else
            {
                observer.SetNext(head);
                observer.SetPrev(null);
                head.SetPrev(observer);
                head = observer;
            }
        }
コード例 #11
0
        public void Attach(InputObserver observer)
        {
            Debug.Assert(observer != null);

            observer.pSubject = this;

            if (pHead == null)
            {
                pHead          = observer;
                observer.pNext = null;
                observer.pPrev = null;
            }

            else
            {
                //attaching to the front
                observer.pNext = pHead;
                observer.pPrev = null;
                pHead.pPrev    = observer;
                pHead          = observer;
            }
        }
コード例 #12
0
 public void Attach(InputObserver observer)
 {
     // protection
     Debug.Assert(observer != null);
     base.baseAttach(observer);
 }
コード例 #13
0
 public void Detach(InputObserver observer)
 {
     base.baseDetach(observer);
 }
コード例 #14
0
 // Constructor ------------------------
 public InputSubject()
 {
     this.head = null;
 }
コード例 #15
0
 public InputSubject()
 {
     observer = null;
 }
コード例 #16
0
 public void setObserver(InputObserver mobserver)
 {
     this.observer = mobserver;
 }