コード例 #1
0
ファイル: Manager.cs プロジェクト: wangjo22/Final
        protected void BaseDestroy()
        {
            DLink pNode;
            DLink pTmpNode;

            pNode = this.pActive;
            while(pNode != null)
            {
                pTmpNode = pNode;
                pNode = pNode.pNext;

                Debug.Assert(pTmpNode != null);
                this.DerivedDestroyNode(pTmpNode);
                DLink.RemoveNode(ref this.pActive, pTmpNode);
                pTmpNode = null;
                this.mNumActive--;
                this.mNumTotal--;
            }

            pNode = this.pReserve;
            while(pNode != null)
            {
                pTmpNode = pNode;
                pNode = pNode.pNext;
                Debug.Assert(pTmpNode != null);
                this.DerivedDestroyNode(pTmpNode);
                DLink.RemoveNode(ref this.pReserve, pTmpNode);
                pTmpNode = null;

                this.mNumReserve--;
                this.mNumTotal--;
            }
        }
コード例 #2
0
        private static void privRemoveNode(ref DLink pHead, DLink pNode)
        {
            // protection
            Debug.Assert(pHead != null);
            Debug.Assert(pNode != null);

            DLink.RemoveNode(ref pHead, pNode);
        }
コード例 #3
0
        protected void BaseRemove(DLink pDlink)
        {
            //depending on where the node is in the list we will have to move stuff around
            DLink.RemoveNode(ref this.poActive, pDlink);
            this.NumActive--;

            this.DerivedWash(pDlink);

            // then send that node or DLink back into the mNumReserve list
            DLink.AddToFront(ref this.poReserve, pDlink);
            this.NumReserve++;
        }
コード例 #4
0
ファイル: Manager.cs プロジェクト: Carsonq/SpaceInvaders
        protected void BaseRemove(DLink pNode)
        {
            Debug.Assert(pNode != null);
            DLink.RemoveNode(ref this.poActive, pNode);

            this.DerivedWash(pNode);

            DLink.AddToFront(ref this.poReserve, pNode);

            this.mNumActive--;
            this.mNumReserved++;
        }
コード例 #5
0
ファイル: Manager.cs プロジェクト: wangjo22/Final
        protected void BaseRemove(DLink pNode)
        {
            Debug.Assert(pNode != null);

            // Transfer the node in active list to reserve list.
            DLink.RemoveNode(ref this.pActive, pNode);
            this.DerivedWash(pNode);
            DLink.AddToFront(ref this.pReserve, pNode);

            // Update Stats
            this.mNumActive--;
            this.mNumReserve++;
        }
コード例 #6
0
ファイル: Manager.cs プロジェクト: AlfredYan/Space_Invaders
        protected void baseRemove(DLink pNode)
        {
            Debug.Assert(pNode != null);

            // remove the node from active list and update states
            DLink.RemoveNode(ref this.pActive, pNode);
            this.mNumActive--;

            // reset the node
            this.derivedReset(pNode);

            // add back to reserved list
            DLink.AddToFront(ref this.pReserved, pNode);
            this.mNumReserved++;
        }
コード例 #7
0
        protected void BaseRemove(DLink pNode)
        {
            Debug.Assert(pNode != null);

            // Don't do the work here... delegate it
            DLink.RemoveNode(ref this.poActive, pNode);

            // wash it before returning to reserve list
            this.DerivedWash(pNode);

            // add it to the return list
            DLink.AddToFront(ref this.poReserve, pNode);

            // stats update
            this.mNumActive--;
            this.mNumReserved++;
        }
コード例 #8
0
        protected void BaseDestroy()
        {
            // search for the name
            DLink pNode;
            DLink pTmpNode;

            // Active List
            pNode = this.poActive;
            while (pNode != null)
            {
                // walking through the list
                pTmpNode = pNode;
                pNode    = pNode.pNext;

                // node to cleanup
                Debug.Assert(pTmpNode != null);
                this.DerivedDestroyNode(pTmpNode);
                DLink.RemoveNode(ref this.poActive, pTmpNode);
                pTmpNode = null;

                this.mNumActive--;
                this.mTotalNumNodes--;
            }

            // Reserve List
            pNode = this.poReserve;
            while (pNode != null)
            {
                // walking through the list
                pTmpNode = pNode;
                pNode    = pNode.pNext;

                // node to cleanup
                Debug.Assert(pTmpNode != null);
                this.DerivedDestroyNode(pTmpNode);
                DLink.RemoveNode(ref this.poReserve, pTmpNode);
                pTmpNode = null;

                this.mNumReserved--;
                this.mTotalNumNodes--;
            }
        }
コード例 #9
0
ファイル: Manager.cs プロジェクト: mrfleming/Space-Invaders
        public void baseRemove(DLink pLink)
        {
            // remove safely
            Debug.Assert(pLink != null);
            DLink target = this.baseFind(pLink);

            DLink.RemoveNode(ref this.poHeadActive, target);

            if (target != null)
            {
                // Clean the node
                target.Clear();
                this.derivedWash(target);

                // Push the node to the reserve list
                DLink.AddToFront(ref this.poHeadReserve, target);

                // update counters
                this.mNumActiveNodes--;
                this.mNumReserveNodes++;
            }
        }
コード例 #10
0
ファイル: Manager.cs プロジェクト: AlfredYan/Space_Invaders
        protected void baseDestory()
        {
            DLink pNode;
            DLink pTmpNode;

            // active list
            pNode = this.pActive;
            while (pNode != null)
            {
                pTmpNode = pNode;
                pNode    = pNode.pNext;

                // cleanup the node
                Debug.Assert(pTmpNode != null);
                this.derivedDestory(pTmpNode);
                DLink.RemoveNode(ref this.pActive, pTmpNode);
                pTmpNode = null;

                this.mNumActive--;
                this.mTotalNumNodes--;
            }

            // reserve list
            pNode = this.pReserved;
            while (pNode != null)
            {
                pTmpNode = pNode;
                pNode    = pNode.pNext;

                // cleanup the node
                Debug.Assert(pTmpNode != null);
                this.derivedDestory(pTmpNode);
                DLink.RemoveNode(ref this.pReserved, pTmpNode);
                pTmpNode = null;

                this.mNumReserved--;
                this.mTotalNumNodes--;
            }
        }
コード例 #11
0
        protected void BaseDestroy()
        {
            DLink pNode;
            DLink pTemp;

            pNode = this.poActive;

            while (pNode != null)
            {
                pTemp = pNode;
                pNode = pNode.pNext;

                Debug.Assert(pTemp != null);
                this.DerivedDestroyNode(pTemp);
                DLink.RemoveNode(ref this.poActive, pTemp);
                pTemp = null;

                this.NumActive--;
                this.TotalNodes--;
            }

            pNode = this.poReserve;

            while (pNode != null)
            {
                pTemp = pNode;
                pNode = pNode.pNext;

                Debug.Assert(pTemp != null);
                this.DerivedDestroyNode(pTemp);
                DLink.RemoveNode(ref this.poReserve, pTemp);
                pTemp = null;

                this.NumReserve--;
                this.TotalNodes--;
            }
        }
コード例 #12
0
 override public void Remove(Component pComponent)
 {
     Debug.Assert(pComponent != null);
     DLink.RemoveNode(ref this.poHead, pComponent);
 }
コード例 #13
0
 public override void remove(Component pComponent)
 {
     Debug.Assert(pComponent != null);
     DLink.RemoveNode(ref this.poHead, ref this.poLast, pComponent);
 }
コード例 #14
0
 public override void Remove(Component pComp)
 {
     Debug.Assert(pComp != null);
     DLink.RemoveNode(ref this.poHead, ref this.poTail, pComp);
 }
コード例 #15
0
 private static void RemoveNode(ref DLink pHead, DLink pNode)
 {
     Debug.Assert(pHead != null);
     Debug.Assert(pNode != null);
     DLink.RemoveNode(ref pHead, pNode);
 }