public void Print() { SBNode pNode = (SBNode)this.BaseGetActive(); while (pNode != null) { Debug.WriteLine("{0}", pNode.GetSpriteBase().GetType()); pNode = (SBNode)pNode.pNext; } }
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; } }
//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; } } }
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); }
//---------------------------------------------------------------------- // 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); }
//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; } }
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; } }