Пример #1
0
        public void DeactivateCollisionSprite()
        {
            SpriteBatchNode sbNode = this.pCollisionObject.pCollisionSpriteBox.GetSpriteBatchNode();

            Debug.Assert(sbNode != null);
            SpriteBatchManager.Remove(sbNode);
        }
Пример #2
0
        protected override MLink createDerivedClassNode()
        {
            MLink mNode = new SpriteBatchNode();
            Debug.Assert(mNode != null);

            return mNode;
        }
Пример #3
0
        protected override void DumpNode(CLink node)
        {
            SpriteBatchNode spNode = (SpriteBatchNode)node;

            Debug.WriteLine(String.Format("\t\tSpriteBatchNode:({0})", spNode.GetHashCode()));
            Debug.WriteLine(String.Format("\t\tstatus:{0}", spNode.status));
        }
Пример #4
0
        public void RecycleAllActive()
        {
            SpriteBatchNode current = (SpriteBatchNode)this.poActiveHead;
            SpriteBatchNode pOld;

            while (current != null)
            {
                if (current.pSprite.pGameObject != null)
                {
                    GameObjectManager.getInstance().Remove(current.pSprite.pGameObject.Wash());
                }

                if (current.pSprite.GetType() == typeof(GameSprite))
                {
                    GameSpriteManager.getInstance().Remove(current.pSprite.Wash());
                }
                else if (current.pSprite.GetType() == typeof(BoxSprite))
                {
                    BoxSpriteManager.getInstance().Remove(current.pSprite.Wash());
                }

                pOld    = current;
                current = (SpriteBatchNode)current.pNext;
                this.Remove(pOld);
            }
        }
Пример #5
0
        public virtual void RemoveSprite()
        {
            Debug.Assert(this.pProxySprite != null);
            SpriteBatchNode sbNode = this.pProxySprite.GetSpriteBatchNode();

            Debug.Assert(sbNode != null);
            SpriteBatchManager.Remove(sbNode);
        }
Пример #6
0
        public static void Remove(SpriteBatchNode spriteBatchNode)
        {
            Debug.Assert(spriteBatchNode != null);
            SpriteBatch sb = spriteBatchNode.GetSpriteBatch();

            Debug.Assert(sb != null);
            sb.Remove(spriteBatchNode);
        }
Пример #7
0
        // Add method for all the types of SpriteBatchNode

        public SpriteBatchNode addToBatch(SpriteBase mSpriteBase)
        {
            // get the SpriteBaseNode from the reserve list to the active list
            SpriteBatchNode spriteGameNode = (SpriteBatchNode)this.cSBNodeManager.add(mSpriteBase);

            Debug.Assert(spriteGameNode != null);
            return(spriteGameNode);
        }
Пример #8
0
        public SpriteBatchNode AddSpriteBatchNode(SpriteBase sprt)
        {
            SpriteBatchNode ret = (SpriteBatchNode)this.PullFromReserved();

            ret.pSprite = sprt;
            this.Add(ret);
            return(ret);
        }
Пример #9
0
        public void Attach(SpriteBase pSpriteBase)
        {
            Debug.Assert(pSpriteBase != null);
            SpriteBatchNode sbNode = (SpriteBatchNode)this.BaseAdd();

            Debug.Assert(sbNode != null);

            sbNode.Set(pSpriteBase, this);
        }
        public static void remove(SpriteBatchNode targetNode)
        {
            Debug.Assert(sbmInstance != null);
            Debug.Assert(targetNode != null);
            SpriteBatchNodeManager sbnMan = targetNode.getSpriteBatchNodeMan();

            Debug.Assert(sbnMan != null);
            sbnMan.remove(targetNode);
        }
Пример #11
0
        public void draw()
        {
            SpriteBatchNode mSpriteBatchNode = (SpriteBatchNode)cSBNodeManager.activeList;

            while (mSpriteBatchNode != null)
            {
                mSpriteBatchNode.cSpriteBase.render();
                mSpriteBatchNode = (SpriteBatchNode)mSpriteBatchNode.pNext;
            }
        }
Пример #12
0
        public SpriteBatchNode add(SpriteBox.SpriteBoxName mSpriteBoxName)
        {
            SpriteBatchNode nodeAdded = (SpriteBatchNode)this.genericAdd();

            Debug.Assert(nodeAdded != null);

            nodeAdded.setSpriteBox(mSpriteBoxName, this);

            return nodeAdded;
        }
Пример #13
0
        public BombRoot(GameObjectName goName, SpriteBaseName sName, float x, float y, int idx)
            : base(goName, sName, BombType.BombRoot, idx)
        {
            this.x = x;
            this.y = y;
            SpriteBatch     sb     = new SpriteBatch();
            SpriteBatchNode sbNode = new SpriteBatchNode();

            sbNode.Set(SpriteManager.Find(SpriteBaseName.Null), sb);
            this.pProxySprite.SetSpriteBatchNode(sbNode);
            this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.White).pAzulColor;
        }
Пример #14
0
        public void removeFromSpriteBatch()
        {
            SpriteBatchNode sbNode = cProxySprite.getSpriteBatchBNode();

            Debug.Assert(sbNode != null);
            SpriteBatchManager.remove(sbNode);

            ///3 lines commented for ghost Manager
            sbNode = this.cCollisionObj.cSpriteBox.getSpriteBatchBNode();
            Debug.Assert(sbNode != null);
            SpriteBatchManager.remove(sbNode);

            GhostManager.add(this);
        }
Пример #15
0
        public void RenderAllActive()
        {
            SpriteBatchNode current = (SpriteBatchNode)this.poActiveHead;

            while (current != null)
            {
                if (current.pSprite.pGameObject != null)
                {
                    current.pSprite.pGameObject.Render();
                }
                else
                {
                    current.pSprite.Render();
                }
                current = (SpriteBatchNode)current.pNext;
            }
        }
Пример #16
0
        // Add given number of Nodes into an empty Reserved List.
        // Called when constructing manager or growing the size
        public override void CreateReservedNodes(int numofNodes)
        {
            DLink tmpNode = new SpriteBatchNode();

            this.poReservedHead = tmpNode;
            int cnt = 1;

            while (cnt < numofNodes)
            {
                tmpNode.pNext       = new SpriteBatchNode();
                tmpNode.pNext.pPrev = tmpNode;
                tmpNode             = tmpNode.pNext;
                cnt++;
            }

            this.mNumReserved = numofNodes;
        }
Пример #17
0
        public virtual void Remove()
        {
            Debug.Assert(this.pProxySprite != null);
            SpriteBatchNode sbNode = this.pProxySprite.GetSpriteBatchNode();

            Debug.Assert(sbNode != null);
            SpriteBatchManager.Remove(sbNode);
            if (GameManager.GetCollisionBoxes())
            {
                if (this.pCollisionObject.pCollisionSpriteBox.pSpriteBatchNode != null)
                {
                    sbNode = this.pCollisionObject.pCollisionSpriteBox.GetSpriteBatchNode();
                    Debug.Assert(sbNode != null);
                    SpriteBatchManager.Remove(sbNode);
                }
            }
            GameObjectManager.Remove(this);
        }
Пример #18
0
        public static void Draw()
        {
            SpriteBatchManager sbMan = SpriteBatchManager.GetInstance();
            SpriteBatch        pSpriteBatchActive = (SpriteBatch)sbMan.pActive;
            SpriteBatchNode    sbNode             = null;

            while (pSpriteBatchActive != null)
            {
                sbNode = (SpriteBatchNode)pSpriteBatchActive.pActive;
                while (sbNode != null)
                {
                    if (sbNode.pSpriteBase != null)
                    {
                        sbNode.pSpriteBase.Render();
                    }
                    sbNode = (SpriteBatchNode)sbNode.pCNext;
                }
                pSpriteBatchActive = (SpriteBatch)pSpriteBatchActive.pDNext;
            }
        }
Пример #19
0
        public void UpdateAllActive()
        {
            SpriteBatchNode current = (SpriteBatchNode)this.poActiveHead;

            while (current != null)
            {
                //Debug.Print(current.pSprite.name.ToString());
                //Debug.Print("x: " + ((GameSprite)(current.pSprite)).poAzulSprite.x);
                //Debug.Print("y: " + ((GameSprite)(current.pSprite)).poAzulSprite.y);
                if (current.pSprite.pGameObject != null)
                {
                    current.pSprite.pGameObject.Update();
                }
                else
                {
                    current.pSprite.Update();
                }

                current = (SpriteBatchNode)current.pNext;
            }
        }
Пример #20
0
        // Not implemented. Yet to implement


        public void remove(SpriteBatchNode targetNode)
        {
            Debug.Assert(targetNode != null);
            this.cSBNodeManager.remove(targetNode);
        }
Пример #21
0
 public override CollectionNode getCollectionObj()
 {
     CollectionNode node = new SpriteBatchNode();
     return node;
 }
Пример #22
0
 public void SetSpriteBatchNode(SpriteBatchNode pSpriteBatchNode)
 {
     Debug.Assert(pSpriteBatchNode != null);
     this.pSpriteBatchNode = pSpriteBatchNode;
 }
Пример #23
0
 protected SpriteBase()
 {
     this.pSpriteBatchNode = null;
 }
Пример #24
0
 public void setSpriteBatchNode(SpriteBatchNode sbNode)
 {
     Debug.Assert(sbNode != null);
     this.spriteBatchNode = sbNode;
 }
Пример #25
0
 public void Remove(SpriteBatchNode sbNode)
 {
     Debug.Assert(sbNode != null);
     this.BaseRemove(sbNode);
 }
Пример #26
0
 public SpriteBase() : base()
 {
     spriteBatchNode = null;
 }
Пример #27
0
 public void remove(SpriteBatchNode targetNode)
 { 
     Debug.Assert(targetNode != null);
     this.genericRemove(targetNode);
 }