예제 #1
0
        public static void Remove(GameSprite pNode)
        {
            GameSpriteMan pMan = GameSpriteMan.privGetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pNode != null);
            pMan.baseRemove(pNode);
        }
예제 #2
0
        public static void Destroy()
        {
            GameSpriteMan pMan = GameSpriteMan.privGetInstance();

            Debug.Assert(pMan != null);

            // Do something clever here
            // track peak number of active nodes
            // print stats on destroy
            // invalidate the singleton
        }
        public static void SetActive(GameSpriteMan pGSMan)
        {
            GameSpriteMan pMan = GameSpriteMan.privGetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pGSMan != null);
            GameSpriteMan.pActiveGSMan = pGSMan;

            // Add a NULL Sprite into the Manager, allows find
            GameSprite pGSprite = GameSpriteMan.Add(GameSprite.Name.NullObject, Image.Name.NullObject, 0, 0, 0, 0);

            Debug.Assert(pGSprite != null);
        }
예제 #4
0
        public static GameSprite Find(GameSprite.Name name)
        {
            GameSpriteMan pMan = GameSpriteMan.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.SetName(name);

            GameSprite pData = (GameSprite)pMan.baseFind(pMan.poNodeCompare);

            return(pData);
        }
예제 #5
0
        public static GameSprite Add(GameSprite.Name name, Image.Name ImageName, float x, float y, float width, float height, Azul.Color pColor = null)
        {
            GameSpriteMan pMan = GameSpriteMan.privGetInstance();

            Debug.Assert(pMan != null);

            GameSprite pNode = (GameSprite)pMan.baseAdd();

            Debug.Assert(pNode != null);

            // Initialize the data
            Image pImage = ImageMan.Find(ImageName);

            Debug.Assert(pImage != null);

            pNode.Set(name, pImage, x, y, width, height, pColor);

            return(pNode);
        }