protected override void derivedPrint(DLink pLink)
        {
            Debug.Assert(pLink != null);
            CollPair pNode = (CollPair)pLink;

            pNode.Print();
        }
Example #2
0
        public override void VisitBomb(Bomb b)
        {
            // Bomb vs WallRoot
            GameObject pGameObj = (GameObject)Iterator.GetChild(this);

            CollPair.Collide(b, pGameObj);
        }
Example #3
0
        public override void VisitBumperRight(BumperRight b)
        {
            // Bumper-Right vs Ship-Root
            GameObject pGameObj = (GameObject)Iterator.GetChild(this);

            CollPair.Collide(b, pGameObj);
        }
Example #4
0
        public override void VisitMissileGroup(MissileGroup mg)
        {
            // MissileRoot vs Shield-Root
            GameObject pGameObj = (GameObject)Iterator.GetChild(mg);

            CollPair.Collide(pGameObj, this);
        }
Example #5
0
        // Visit Bumpers
        //----------------------------------------------------------------------------------
        public override void VisitBumperGroup(BumperGroup bg)
        {
            // Bumper-Group vs Ship-Root
            GameObject pGameObj = (GameObject)Iterator.GetChild(bg);

            CollPair.Collide(pGameObj, this);
        }
Example #6
0
        public override void VisitMissile(Missile m)
        {
            // Missile vs Shield-Root
            GameObject pGameObj = (GameObject)Iterator.GetChild(this);

            CollPair.Collide(m, pGameObj);
        }
Example #7
0
        public override void VisitMissileGroup(MissileGroup mg)
        {
            // MissileGroup vs Wall-Top
            GameObject pGameObj = (GameObject)Iterator.GetChild(mg);

            CollPair.Collide(pGameObj, this);
        }
Example #8
0
        public override void VisitBombRoot(BombRoot br)
        {
            // BombRoot vs WallRoot
            GameObject pGameObj = (GameObject)Iterator.GetChild(br);

            CollPair.Collide(pGameObj, this);
        }
        //----------------------------------------------------------------------------------
        // Abstract Methods
        //----------------------------------------------------------------------------------

        protected override DLink derivedCreateNode()
        {
            DLink pNode = new CollPair();

            Debug.Assert(pNode != null);

            return(pNode);
        }
Example #10
0
        public override void VisitAlien(AlienGO a)
        {
            // Alien vs Wall-Bottom
            CollPair pColPair = CollPairManager.GetActiveCollPair();

            pColPair.SetCollision(a, this);
            pColPair.NotifyListeners();
        }
Example #11
0
        public override void VisitBomb(Bomb b)
        {
            // Bomb vs Wall-Bottom
            CollPair pColPair = CollPairManager.GetActiveCollPair();

            pColPair.SetCollision(b, this);
            pColPair.NotifyListeners();
        }
        //----------------------------------------------------------------------------------
        // Constructor
        //----------------------------------------------------------------------------------
        private CollPairManager(int initReserve = 3, int growthRate = 1) : base()
        {
            this.baseInitialize(initReserve, growthRate);

            this.pActiveCollPair = null;

            this.poNodeCompare = new CollPair();
        }
Example #13
0
        public override void VisitWallGroup(WallGroup wg)
        {
            //Debug.WriteLine("         collide:  {0} <-> {1}", wg.GetName(), this.GetName());

            // WallGroup vs AlienGrid
            GameObject pGameObj = (GameObject)Iterator.GetChild(this);

            CollPair.Collide(wg, pGameObj);
        }
Example #14
0
        public override void VisitMissile(Missile m)
        {
            // Missile vs ShieldBrick
            //Debug.WriteLine(" ---> Shild Brick Destroyed!");
            CollPair pCollPair = CollPairManager.GetActiveCollPair();

            pCollPair.SetCollision(m, this);
            pCollPair.NotifyListeners();
        }
Example #15
0
        public override void VisitBomb(Bomb b)
        {
            // Bomb vs Ship
            Debug.WriteLine(" ---> Bomb Hit Ship");
            CollPair pColPair = CollPairManager.GetActiveCollPair();

            pColPair.SetCollision(b, this);
            pColPair.NotifyListeners();
        }
Example #16
0
        public override void VisitBumperRight(BumperRight b)
        {
            // Bumper-Left vs ShieldBrick
            //Debug.WriteLine(" ---> Hit bumper Right!");
            CollPair pCollPair = CollPairManager.GetActiveCollPair();

            pCollPair.SetCollision(b, this);
            pCollPair.NotifyListeners();
        }
Example #17
0
        public override void VisitAlien(AlienGO a)
        {
            // Alien vs Shield-Brick
            Debug.WriteLine(" ---> GAAAAAHHHHHHHHH!!!!!!!!");
            CollPair pColPair = CollPairManager.GetActiveCollPair();

            pColPair.SetCollision(a, this);
            pColPair.NotifyListeners();
        }
Example #18
0
        public override void VisitMissileGroup(MissileGroup mg)
        {
            //Debug.WriteLine("         collide:  {0} <-> {1}", mg.GetName(), this.GetName());

            // MissileGroup vs Alien
            GameObject pGameObj = (GameObject)Iterator.GetChild(mg);

            CollPair.Collide(pGameObj, this);
        }
        public static void Remove(CollPair pNode)
        {
            CollPairManager pManager = CollPairManager.privGetInstance();

            Debug.Assert(pManager != null);
            Debug.Assert(pNode != null);

            // delegate to abstract manager who deals with the DLinks
            pManager.baseRemove(pNode);
        }
Example #20
0
        public override void VisitMissile(Missile m)
        {
            // Missile vs Wall-Top
            CollPair pCollPair = CollPairManager.GetActiveCollPair();

            Debug.Assert(pCollPair != null);

            // Register collisiton and notify the observers
            pCollPair.SetCollision(m, this);
            pCollPair.NotifyListeners();

            // Who delete the bombs??
        }
Example #21
0
        public override void VisitMissile(Missile m)
        {
            // Missile vs Alien
            //Debug.WriteLine("         collide:  {0} <-> {1}", m.GetName(), this.GetName());

            //Alien vs Missile
            Debug.WriteLine("----> Hit an {0}! <-----", this.GetName());

            CollPair pCollPair = CollPairManager.GetActiveCollPair();

            pCollPair.SetCollision(m, this);
            pCollPair.NotifyListeners();
        }
        protected override bool derivedCompare(DLink pLinkA, DLink pLinkB)
        {
            //This is called by baseFind
            Debug.Assert(pLinkA != null);
            Debug.Assert(pLinkB != null);

            //Cast to type
            CollPair pA = (CollPair)pLinkA;
            CollPair pB = (CollPair)pLinkB;

            // result of comparison, expression results a bool
            return(pA.GetName() == pB.GetName());
        }
        public static CollPair Find(CollPair.Name theName)
        {
            CollPairManager pManager = CollPairManager.privGetInstance();

            Debug.Assert(pManager != null);

            // set common compare node, static object ref
            pManager.poNodeCompare.SetName(theName);

            //find and return ref
            CollPair pNode = (CollPair)pManager.baseFind(pManager.poNodeCompare);

            Debug.Assert(pNode != null);
            return(pNode);
        }
        public static CollPair Add(CollPair.Name collpairName, GameObject treeRootA, GameObject treeRootB)
        {
            CollPairManager pManager = CollPairManager.privGetInstance();

            Debug.Assert(pManager != null);

            // Grab off the reserve
            CollPair pCollPair = (CollPair)pManager.baseAdd();

            Debug.Assert(pCollPair != null);

            pCollPair.Set(collpairName, treeRootA, treeRootB);

            return(pCollPair);
        }
Example #25
0
        public override void VisitAlienGrid(AlienGrid ag)
        {
            // AlienGrid vs Wall-Right
            //Debug.WriteLine("\ncollide: {0} with {1}", this, ag);
            //Debug.WriteLine("               --->DONE<----");

            // Set a new direction : Positive means go right -->
            ag.SetDelta(-1.0f);
            ag.SetIsOnWall(true);

            CollPair pCollPair = CollPairManager.GetActiveCollPair();

            Debug.Assert(pCollPair != null);

            // Register collisiton and notify the observers
            pCollPair.SetCollision(ag, this);
            pCollPair.NotifyListeners();
        }
        public static void Process()
        {
            CollPairManager pManager = CollPairManager.privGetInstance();

            Debug.Assert(pManager != null);

            // Get ref to Active list
            CollPair pCollPair = (CollPair)pManager.baseGetActive();

            while (pCollPair != null)
            {
                //set to active
                pManager.pActiveCollPair = pCollPair;
                // Do it
                pCollPair.Process();
                // Go to next
                pCollPair = (CollPair)pCollPair.pNext;
            }
        }
Example #27
0
 public override void VisitColumn(AlienColumn ac)
 {
     // Alien Column vs ShieldRoot
     CollPair.Collide((GameObject)Iterator.GetChild(ac), this);
 }
Example #28
0
 public override void VisitAlien(AlienGO a)
 {
     // Alien vs ShieldRoot
     CollPair.Collide(a, (GameObject)Iterator.GetChild(this));
 }
Example #29
0
 public override void VisitBomb(Bomb b)
 {
     // Missile vs ShieldRoot
     CollPair.Collide(b, (GameObject)Iterator.GetChild(this));
 }
Example #30
0
 public override void VisitBombRoot(BombRoot br)
 {
     // BombRoot vs ShieldRoot
     CollPair.Collide((GameObject)Iterator.GetChild(br), this);
 }