Esempio n. 1
0
        public void Print()
        {
            SBNode pNode = (SBNode)this.BaseGetActive();

            while (pNode != null)
            {
                Debug.WriteLine("{0}", pNode.GetSpriteBase().GetType());
                pNode = (SBNode)pNode.pNext;
            }
        }
Esempio n. 2
0
        public void Draw()
        {
            // walk through the list and render
            SBNode pNode = (SBNode)this.BaseGetActive();

            while (pNode != null)
            {
                // Assumes someone before here called update() on each sprite
                // Draw me.
                pNode.GetSpriteBase().Render();
                pNode = (SBNode)pNode.pNext;
            }
        }
Esempio n. 3
0
        //public SpriteBatch GetBackToSpriteBatch()
        //{
        //    Debug.Assert(this.pBackToSpriteBatch != null);
        //    return this.pBackToSpriteBatch;
        //}

        //public void SetBackToSpriteBatch(SpriteBatch pSpriteBatch)
        //{
        //    Debug.Assert(pSpriteBatch != null);
        //    this.pBackToSpriteBatch = pSpriteBatch;
        //}

        public void Draw()
        {
            SBNode pNode = (SBNode)this.BaseGetActive();

            // Update() should be called in each sprites before call this Draw() function.

            if (this.collisionBoxToggle == true)
            {
                while (pNode != null)
                {
                    pNode.GetSpriteBase().Render();
                    pNode = (SBNode)pNode.pNext;
                }
            }
        }
Esempio n. 4
0
        public void Draw()
        {
            SBNode pSpriteBatchNode = (SBNode)this.pSBNodeMan.GetActive();

            //int debugPrintCount = 0;
            while (pSpriteBatchNode != null)
            {
                //debugPrintCount++;
                // Assumes someone before here called update() on each sprite
                // OK... data is right so --> Draw me.
                pSpriteBatchNode.GetSpriteBase().Draw();

                pSpriteBatchNode = (SBNode)pSpriteBatchNode.pMNext;
            }
            //Debug.WriteLine("{0} sprites from SpriteBatch({1}) drawn", debugPrintCount, this.name);
        }
Esempio n. 5
0
        //----------------------------------------------------------------------
        // Override Abstract methods
        //----------------------------------------------------------------------
        protected override bool DerivedCompare(DLink pLinkA, DLink pLinkB)
        {
            Debug.Assert(pLinkA != null);
            Debug.Assert(pLinkB != null);

            SBNode pDataA = (SBNode)pLinkA;
            SBNode pDataB = (SBNode)pLinkB;

            Boolean status = false;

            if (pDataA.GetSpriteBase() == pDataB.GetSpriteBase())
            {
                status = true;
            }

            return(status);
        }
Esempio n. 6
0
        //just like the set methods in SBNode; attach for each type
        //public SBNode Attach(GameSprite.Name name)
        //{
        //    // take node from reserve, wash the links
        //    //adds it to the active list and set the name
        //    SBNode pNode = (SBNode)this.baseAdd();
        //    Debug.Assert(pNode != null);

        //    // sets the SBnode pointer
        //    pNode.Set(name);

        //    return pNode;
        //}

        //public SBNode Attach(BoxSprite.Name name)
        //{
        //    // take node from reserve, wash the links
        //    //adds it to the active list and set the name
        //    SBNode pNode = (SBNode)this.baseAdd();
        //    Debug.Assert(pNode != null);

        //    //sets the SBnode pointer
        //    pNode.Set(name);

        //    return pNode;
        //}

        //public SBNode Attach(ProxySprite pNode)
        //{
        //    SBNode pSBNode = (SBNode)this.baseAdd();
        //    Debug.Assert(pNode != null);

        //    pSBNode.Set(pNode);
        //    return pSBNode;
        //}

        public void Draw()
        {
            // starting node
            SBNode pNode = (SBNode)this.BaseGetActive();

            SBNode pNext = null;

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

                pNode.GetSpriteBase().Render();

                //ok because all nodes in this are SpriteBase objects
                pNode = pNext;
            }
        }
Esempio n. 7
0
        public static void Update()
        {
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);
            SpriteBatch pSpriteBatch = (SpriteBatch)pMan.BaseGetActive();

            while (pSpriteBatch != null)
            {
                SBNodeMan pSBNodeMan = pSpriteBatch.GetSBNodeMan();
                Debug.Assert(pSBNodeMan != null);

                SBNode pNode = (SBNode)pSBNodeMan.BaseGetActive();

                while (pNode != null)
                {
                    pNode.GetSpriteBase().Update();

                    pNode = (SBNode)pNode.pNext;
                }

                pSpriteBatch = (SpriteBatch)pSpriteBatch.pNext;
            }
        }