public virtual void Remove() { // Very difficult at first... if you are messy, you will pay here! // Given a game object.... // Remove from SpriteBatch // Find the SBNode Debug.Assert(this.pProxySprite != null); SBNode pSBNode = this.pProxySprite.GetSBNode(); // Remove it from the manager Debug.Assert(pSBNode != null); SpriteBatchMan.Remove(pSBNode); // Remove collision sprite from spriteBatch Debug.Assert(this.poColObj != null); Debug.Assert(this.poColObj.pColSprite != null); pSBNode = this.poColObj.pColSprite.GetSBNode(); Debug.Assert(pSBNode != null); SpriteBatchMan.Remove(pSBNode); // Remove from GameObjectMan GameObjectMan.Remove(this); //GhostMan.Add(this); }
public virtual void Remove() { Debug.WriteLine("REMOVE: {0}", this); // Remove from SpriteBatch // Find the SpriteNode Debug.Assert(this.pProxySprite != null); SpriteNode pSpriteNode = this.pProxySprite.GetSpriteNode(); // Remove it from the manager Debug.Assert(pSpriteNode != null); SpriteBatchMan.Remove(pSpriteNode); // Remove collision sprite from spriteBatch Debug.Assert(this.poColObj != null); Debug.Assert(this.poColObj.pColSprite != null); pSpriteNode = this.poColObj.pColSprite.GetSpriteNode(); Debug.Assert(pSpriteNode != null); SpriteBatchMan.Remove(pSpriteNode); // Remove from GameObjectMan GameObjectMan.Remove(this); //GhostMan.Add(this); }
//---------------------------------------------------------------------- // Abstract methods //---------------------------------------------------------------------- public virtual void remove() { //Debug.WriteLine("REMOVE: {0}", this); // remove from SpriteBatch Debug.Assert(this.getProxySprite() != null); SBNode pSBNode = this.getProxySprite().GetSBNode(); // remove it from the manager Debug.Assert(pSBNode != null); SpriteBatchMan.Remove(pSBNode); // remove collision sprite from spriteBatch Debug.Assert(this.poCollisionObject != null); Debug.Assert(this.poCollisionObject.pCollisionSprite != null); pSBNode = this.poCollisionObject.pCollisionSprite.GetSBNode(); Debug.Assert(pSBNode != null); SpriteBatchMan.Remove(pSBNode); // remove from GameObjectMan GameObjectMan.Remove(this); }