// public public static void Create(int init = 2, int delta = 2) { if (pMan == null) { pMan = new BoxSpriteMan(init, delta); } }
public static void PrintSpriteBoxes() { BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance(); Debug.Assert(pBSMan != null); pBSMan.BaseDumpNodes(); }
public static void Remove(BoxSprite pSBnode) { BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance(); Debug.Assert(pBSMan != null); pBSMan.BaseRemove(pSBnode); }
public static void Dump() { BoxSpriteMan pMan = BoxSpriteMan.privGetInstance(); Debug.Assert(pMan != null); pMan.baseDump(); }
public static void Remove(BoxSprite pNode) { BoxSpriteMan pMan = BoxSpriteMan.privGetInstance(); Debug.Assert(pMan != null); Debug.Assert(pNode != null); pMan.baseRemove(pNode); }
private void PrivStatDump() { BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance(); Debug.Assert(pBSMan != null); Debug.WriteLine(""); Debug.WriteLine("BoxSprite Manager Stats---------------------"); pBSMan.BaseStatDump(); }
public static void Remove(BoxSprite pBoxSprite) { //ensure call Create() first BoxSpriteMan pMan = BoxSpriteMan.GetInstance(); Debug.Assert(pMan != null); Debug.Assert(pBoxSprite != null); pMan.baseRemove(pBoxSprite); }
public CollisionObject(ProxySprite pProxy) { Debug.Assert(pProxy != null); this.poCollisionRect = new CollisionRect(pProxy.GetSpriteRect()); this.pCollsionBoxSprite = BoxSpriteMan.Add(this.poCollisionRect.x, this.poCollisionRect.y, this.poCollisionRect.width, this.poCollisionRect.height); Debug.Assert(this.pCollsionBoxSprite != null); this.pCollsionBoxSprite.SetLineColor(1.0f, 1.0f, 0.0f); }
public static void Create(int reserveNum, int growth) { Debug.Assert(reserveNum > 0); Debug.Assert(growth > 0); Debug.Assert(pInstance == null); if (pInstance == null) { pInstance = new BoxSpriteMan(reserveNum, growth); } }
public static void Destroy() { BoxSpriteMan pMan = BoxSpriteMan.privGetInstance(); Debug.Assert(pMan != null); // Do something clever here // track peak number of active nodes // print stats on destroy // invalidate the singleton }
//----------------------------------------------------------------------------- // Game::UnLoadContent() // unload content (resources loaded above) // unload all content that was loaded before the Engine Loop started //----------------------------------------------------------------------------- public override void UnLoadContent() { GameObjectMan.Destory(); ProxySpriteMan.Destory(); TimerMan.Destory(); SpriteBatchMan.Destory(); GameSpriteMan.Destory(); BoxSpriteMan.Destory(); ImageMan.Destory(); TextureMan.Destory(); }
public static BoxSprite Find(BoxSprite.Name name) { BoxSpriteMan pMan = BoxSpriteMan.privGetInstance(); Debug.Assert(pMan != null); pMan.poNodeCompare.SetName(name); BoxSprite pData = (BoxSprite)pMan.baseFind(pMan.poNodeCompare); return(pData); }
public static BoxSprite Find(BoxSprite.Name name) { BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance(); Debug.Assert(pBSMan != null); pBSMan.poNodeCompare.SetName(name); BoxSprite pBSnode = (BoxSprite)pBSMan.BaseFind(pBSMan.poNodeCompare); return(pBSnode); }
public static void Destory() { //ensure call Create() first BoxSpriteMan pMan = BoxSpriteMan.GetInstance(); Debug.Assert(pMan != null); pMan.baseDestory(); pMan.poNodeForCompare = null; BoxSpriteMan.pInstance = null; }
public static BoxSprite Find(BoxSprite.Name name) { //ensure call Create() first BoxSpriteMan pMan = BoxSpriteMan.GetInstance(); Debug.Assert(pMan != null); pMan.poNodeForCompare.setName(name); BoxSprite pData = (BoxSprite)pMan.baseFind(pMan.poNodeForCompare); return(pData); }
public override void unLoadContent(Scene pScene) { GameObjectMan.Reset(); TimerMan.Reset(); InputMan.Reset(); CollisionPairMan.Reset(); SpriteBatchMan.Reset(); BoxSpriteMan.Reset(); ProxySpriteMan.Reset(); UFOMan.Reset(); ShipMan.Reset(); }
public static BoxSprite Add(BoxSprite.Name name, float x, float y, float width, float height, Azul.Color pColor = null) { BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance(); Debug.Assert(pBSMan != null); BoxSprite pBSnode = (BoxSprite)pBSMan.BaseAdd(); Debug.Assert(pBSnode != null); pBSnode.Set(name, x, y, width, height, pColor); return(pBSnode); }
//---------------------------------------------------------------------- // Static Methods //---------------------------------------------------------------------- public static void Create(int reserveNum = 3, int reserveGrow = 1) { Debug.Assert(reserveNum > 0); Debug.Assert(reserveGrow > 0); // initialize the singleton here Debug.Assert(pInstance == null); // Do the initialization if (pInstance == null) { pInstance = new BoxSpriteMan(reserveNum, reserveGrow); } }
//---------------------------------------------------------------------- // Static Methods //---------------------------------------------------------------------- public static void Create(int reserveNum = 3, int reserveGrow = 1) { // make sure parameters are ressonable Debug.Assert(reserveNum > 0); Debug.Assert(reserveGrow > 0); // ensure the instance of BoxSpriteMan has not been created Debug.Assert(BoxSpriteMan.pInstance == null); if (BoxSpriteMan.pInstance == null) { pInstance = new BoxSpriteMan(reserveNum, reserveGrow); } }
public static BoxSprite Add(BoxSprite.Name name, float x, float y, float width, float height, Azul.Color pColor = null) { //ensure call Create() first BoxSpriteMan pMan = BoxSpriteMan.GetInstance(); Debug.Assert(pMan != null); BoxSprite pBoxSprite = (BoxSprite)pMan.baseAdd(); Debug.Assert(pBoxSprite != null); pBoxSprite.set(name, x, y, width, height, pColor); return(pBoxSprite); }
public static void Destroy() { BoxSpriteMan pMan = BoxSpriteMan.privGetInstance(); Debug.Assert(pMan != null); // Print stats on destroy pMan.baseDump(); // Invalidate the singleton if (pInstance != null) { pInstance = null; } }
public static BoxSprite Find(BoxSprite.Name name) { BoxSpriteMan pMan = BoxSpriteMan.PrivGetInstance(); Debug.Assert(pMan != null); // Compare functions only compares two Nodes // So: Use the Compare Node - as a reference // use in the Compare() function pMan.poNodeCompare.name = name; BoxSprite pData = (BoxSprite)pMan.BaseFind(pMan.poNodeCompare); return(pData); }
public override void UnLoadContent() { TimerMan.Destroy(); TextureMan.Destroy(); ImageMan.Destroy(); GameSpriteMan.Destroy(); BoxSpriteMan.Destroy(); pSpriteBatchMan.Destroy(); ProxySpriteMan.Destroy(); GlyphMan.Destroy(); //GameObjectMan.Destroy(); ColPairMan.Destroy(); FontMan.Destroy(); ShipMan.Destroy(); }
public static void Reset() { //ensure call Create() first BoxSpriteMan pMan = BoxSpriteMan.GetInstance(); Debug.Assert(pMan != null); BoxSprite pBoxSprite = (BoxSprite)pMan.pActive; while (pBoxSprite != null) { pBoxSprite.deepClear(); pBoxSprite = (BoxSprite)pBoxSprite.pNext; } pMan.baseSetActiveHead(null); }
//--------------------------------------------------------------------------------------------------------- // Constructor //--------------------------------------------------------------------------------------------------------- public CollisionObject(ProxySprite pProxySprite) { Debug.Assert(pProxySprite != null); // create collision Rect // use the reference sprite to set size and shape GameSprite pGameSprite = pProxySprite.getGameSprite(); Debug.Assert(pGameSprite != null); this.poCollisionRect = new CollisionRect(pGameSprite.getScreenRect()); Debug.Assert(this.poCollisionRect != null); // create collision sprite(box sprite) this.pCollisionSprite = BoxSpriteMan.Add(BoxSprite.Name.Box, this.poCollisionRect.x, this.poCollisionRect.y, this.poCollisionRect.width, this.poCollisionRect.height); Debug.Assert(this.pCollisionSprite != null); this.pCollisionSprite.setLineColor(1.0f, 0.0f, 0.0f); }
override public void Unload() { //SpriteBatchMan.Remove(pSB_Texts); //SpriteBatchMan.Remove(pSB_Texts); SpriteBatchMan.Destroy(); TextureMan.Destroy(); GlyphMan.Destroy(); FontMan.Destroy(); ImageMan.Destroy(); GameSpriteMan.Destroy(); BoxSpriteMan.Destroy(); ProxySpriteMan.Destroy(); GameObjectMan.Destroy(); InputMan.Destroy(); this.Handle(); }
override public void Unload() { SpriteBatchMan.Destroy(); TextureMan.Destroy(); GlyphMan.Destroy(); FontMan.Destroy(); ImageMan.Destroy(); GameSpriteMan.Destroy(); BoxSpriteMan.Destroy(); ProxySpriteMan.Destroy(); GameObjectMan.Destroy(); TimerMan.Destroy(); ColPairMan.Destroy(); Simulation.Destroy(); InputMan.Destroy(); this.Handle(); }
public ColObject(ProxySprite pProxySprite) { Debug.Assert(pProxySprite != null); //use the Proxy's game Sprite for size and shape of collision rectangle GameSprite pSprite = pProxySprite.GetRealSprite(); Debug.Assert(pSprite != null); //get the dimensions from the game sprite's rectangle // and store it in the collision rectangle this.poColRect = new ColRect(pSprite.GetScreenRect()); Debug.Assert(this.poColRect != null); //create the collision sprite from the collision rectangle this.pColSprite = BoxSpriteMan.Add(BoxSprite.Name.BoxSprite1, this.poColRect.x, this.poColRect.y, this.poColRect.width, this.poColRect.height); Debug.Assert(this.pColSprite != null); this.pColSprite.SetLineColor(1.0f, 1.0f, 1.0f); }
public ColObject(ProxySprite pProxySprite) { Debug.Assert(pProxySprite != null); // Create Collision Rect // Use the reference sprite to set size and shape // need to refactor if you want it different GameSprite pSprite = pProxySprite.pSprite; Debug.Assert(pSprite != null); // Origin is in the UPPER RIGHT this.poColRect = new ColRect(pSprite.GetScreenRect()); Debug.Assert(this.poColRect != null); // Create the sprite this.pColSprite = BoxSpriteMan.Add(BoxSprite.Name.Box, this.poColRect.x, this.poColRect.y, this.poColRect.width, this.poColRect.height); Debug.Assert(this.pColSprite != null); this.pColSprite.SetLineColor(1.0f, 0.0f, 0.0f); }
public static void Destroy() { // Get the instance BoxSpriteMan pMan = BoxSpriteMan.PrivGetInstance(); Debug.Assert(pMan != null); #if (TRACK_DESTRUCTOR_MAN) Debug.WriteLine("--->BoxSpriteMan.Destroy()"); #endif pMan.BaseDestroy(); #if (TRACK_DESTRUCTOR_MAN) Debug.WriteLine(" {0} ({1})", pMan.poNodeCompare, pMan.poNodeCompare.GetHashCode()); Debug.WriteLine(" {0} ({1})", BoxSpriteMan.pInstance, BoxSpriteMan.pInstance.GetHashCode()); #endif pMan.poNodeCompare = null; BoxSpriteMan.pInstance = null; }