Beispiel #1
0
        public static void ResetAllShieldGrid()
        {
            ShieldNodeManager pMan = ShieldNodeManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            ShieldNode     pCurr = (ShieldNode)pMan.BaseGetActive();
            ShieldNode     pNext;
            GameObject     pParent;
            GameObject     pObj;
            ShieldCategory pShield;

            while (pCurr != null)
            {
                pNext = (ShieldNode)pCurr.pNext;

                // Get Alien object and its parent. The parent will be AlienGroup or AlienColumn.
                pObj = pCurr.GetAlienObject();

                pParent = (GameObject)pCurr.GetAlienObject().pParent;

                pObj.isDead = false;

                pObj.pPrev = null;
                pObj.pNext = null;

                pParent.Add(pObj);

                if (pObj.type == Component.Container.LEAF)
                {
                    pShield = (ShieldCategory)pObj;

                    SpriteBatch pSB_ShieldSprite = SpriteBatchManager.Find(SpriteBatch.Name.ShieldSprites);
                    Debug.Assert(pSB_ShieldSprite != null);

                    pSB_ShieldSprite.Attach(pObj.pProxySprite);
                    // pMan.pSB_GameSprite.Attach(pObj.pProxySprite);
                }

                SpriteBatch pSB_Collsion = SpriteBatchManager.Find(SpriteBatch.Name.BoxSprites);
                pSB_Collsion.Attach(pObj.pColObject.pBoxSprite);
                // pMan.pSB_CollisionSprite.Attach(pObj.pColObject.pBoxSprite);

                ShieldNodeManager.Remove(pCurr);

                DLink p = pMan.BaseGetActive();

                pCurr = pNext;
            }

            // Checked new Alien Hierarchy is good
            //  pMan.pSB_GameSprite.Dump();
            //  pMan.pSB_CollisionSprite.Dump();
        }
Beispiel #2
0
        public static void PrintMe()
        {
            ShieldNodeManager pMan = ShieldNodeManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            ShieldNode pNode = (ShieldNode)pMan.BaseGetActive();

            while (pNode != null)
            {
                pNode.PrintMe();
                pNode = (ShieldNode)pNode.pNext;
            }
        }