Beispiel #1
0
        protected override void DerivedWash(DLink pLink)
        {
            Debug.Assert(pLink != null);
            ShieldNode pNode = (ShieldNode)pLink;

            pNode.Wash();
        }
Beispiel #2
0
        public static void Remove(ShieldNode pNode)
        {
            ShieldNodeManager pMan = ShieldNodeManager.PrivGetInstance();

            Debug.Assert(pMan != null);
            Debug.Assert(pNode != null);
            pMan.BaseRemove(pNode);
        }
Beispiel #3
0
        protected override DLink DerivedCreateNode()
        {
            DLink pNode = new ShieldNode();

            Debug.Assert(pNode != null);

            return(pNode);
        }
Beispiel #4
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 #5
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;
            }
        }
Beispiel #6
0
        protected override bool DerivedCompare(DLink pLinkA, DLink pLinkB)
        {
            Debug.Assert(pLinkA != null);
            Debug.Assert(pLinkB != null);

            ShieldNode pDataA = (ShieldNode)pLinkA;
            ShieldNode pDataB = (ShieldNode)pLinkB;

            Boolean status = false;

            if (pDataA.index == pDataB.index)
            {
                status = true;
            }

            return(status);
        }
Beispiel #7
0
        public static ShieldNode Add(GameObject pObj)
        {
            Debug.Assert(pObj != null);

            ShieldNodeManager pMan = ShieldNodeManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            // Take a node out from Reserve list.
            // This node is washed in BasePopNode().

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

            Debug.Assert(pNode != null);

            pNode.Set(pObj);
            pMan.BaseSortedAdd(pNode);
            return(pNode);
        }
Beispiel #8
0
 protected override void DerivedDumpNode(DLink pLink)
 {
     Debug.Assert(pLink != null);
     ShieldNode pData = (ShieldNode)pLink;
     //pData.Dump();
 }
 public static Hierarchy create(Hierarchy.ShieldCol col, Azul.Color color)
 {
     Hierarchy node = new ShieldNode(color);
     SpriteBatchManager.attachToGroup(node.ColObj.Spr, BatchGroup.BatchType.Collisions);
     TreeNode subRoot = GameObjectManager.find(GameObject.Name.Shields);
     GameObjectManager.insert(node, subRoot);
     return node;
 }
 public static Hierarchy create(Hierarchy.Shields shield, Azul.Color color)
 {
     Hierarchy node = new ShieldNode(color);
     GameObjectManager.addRoot(node);
     SpriteBatchManager.attachToGroup(node.ColObj.Spr, BatchGroup.BatchType.Collisions);
     return node;
 }
Beispiel #11
0
 public override void visitShieldNode(ShieldNode sb, CollisionPair p)
 {
     p.collision((GameObject)sb.Child, this);
 }
Beispiel #12
0
 public override void visitShieldNode(ShieldNode sb, CollisionPair p)
 {
     p.collision(sb, (GameObject)this.child);
 }
Beispiel #13
0
 public virtual void visitShieldNode(ShieldNode sb, CollisionPair p)
 {
     Debug.Assert(false, "Shouldn't have been called");
 }