Ejemplo n.º 1
0
 // public
 public static void Create(int init = 2, int delta = 2)
 {
     if (pMan == null)
     {
         pMan = new BoxSpriteMan(init, delta);
     }
 }
Ejemplo n.º 2
0
        public static void PrintSpriteBoxes()
        {
            BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance();

            Debug.Assert(pBSMan != null);

            pBSMan.BaseDumpNodes();
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 6
0
        private void PrivStatDump()
        {
            BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance();

            Debug.Assert(pBSMan != null);

            Debug.WriteLine("");
            Debug.WriteLine("BoxSprite Manager Stats---------------------");
            pBSMan.BaseStatDump();
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
            }
        }
Ejemplo n.º 10
0
        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
        }
Ejemplo n.º 11
0
 //-----------------------------------------------------------------------------
 // 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);
        }
Ejemplo n.º 13
0
        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);
        }
Ejemplo n.º 14
0
        public static void Destory()
        {
            //ensure call Create() first
            BoxSpriteMan pMan = BoxSpriteMan.GetInstance();

            Debug.Assert(pMan != null);

            pMan.baseDestory();

            pMan.poNodeForCompare  = null;
            BoxSpriteMan.pInstance = null;
        }
Ejemplo n.º 15
0
        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);
        }
Ejemplo n.º 16
0
 public override void unLoadContent(Scene pScene)
 {
     GameObjectMan.Reset();
     TimerMan.Reset();
     InputMan.Reset();
     CollisionPairMan.Reset();
     SpriteBatchMan.Reset();
     BoxSpriteMan.Reset();
     ProxySpriteMan.Reset();
     UFOMan.Reset();
     ShipMan.Reset();
 }
Ejemplo n.º 17
0
        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);
            }
        }
Ejemplo n.º 19
0
        //----------------------------------------------------------------------
        // 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);
            }
        }
Ejemplo n.º 20
0
        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;
            }
        }
Ejemplo n.º 22
0
        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();
        }
Ejemplo n.º 24
0
        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);
        }
Ejemplo n.º 25
0
        //---------------------------------------------------------------------------------------------------------
        // 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);
        }
Ejemplo n.º 26
0
        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();
        }
Ejemplo n.º 27
0
        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();
        }
Ejemplo n.º 28
0
        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);
        }
Ejemplo n.º 29
0
        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);
        }
Ejemplo n.º 30
0
        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;
        }