Beispiel #1
0
        public void RemoveComposite()
        {
            if (this.poHead != null && this.poLast != null)
            {
                return;
            }

            if (this is AlienColumn)
            {
                AlienManager.Add(this);
            }

            if (this is ShieldColumn)
            {
                ShieldNodeManager.Add(this);
            }

            Composite pParent = (Composite)this.pParent;

            if (this.pPrev == null && this.pNext == null)
            {
                pParent.poLast = null;
                pParent.poHead = null;
            }
            else if (this.pPrev == null)
            {
                pParent.poHead   = this.pNext;
                this.pNext.pPrev = null;
            }
            else if (this.pNext == null)
            {
                pParent.poLast   = this.pPrev;
                this.pPrev.pNext = null;
            }
            else
            {
                this.pPrev.pNext = this.pNext;
                this.pNext.pPrev = this.pPrev;
            }
            this.RemoveFromSpriteBatch();
            this.pPrev = null;
            this.pNext = null;
            this.Remove(this);

            if (pParent.poHead == null && pParent.poLast == null && pParent.pNext == null && pParent.pPrev == null)
            {
                pParent.Remove(this);
                if (pParent is AlienGroup)
                {
                    GameScene.Handle();
                }
                //AlienManager.PrintMe();
                //AlienManager.ResetAllAlienGrid();
                //pParent.RemoveFromSpriteBatch();
            }
        }
Beispiel #2
0
 public override void Execute()
 {
     AlienManager.Add(this.pAlien);
     this.pAlien.GotHitMissile();
 }