public override void Notify() { if (IsValidCollision() && this.pBrick.isDead == false) { this.pBrick.isDead = true; DelayRemoveManager.Attach(new RemoveBrickObserver(this)); } }
private static DelayRemoveManager PrivGetInstance() { if (pInstance == null) { pInstance = new DelayRemoveManager(); } Debug.Assert(pInstance != null); return(pInstance); }
public override void Notify() { if (IsValidCollision() && !this.pBomb.isDead) { pBomb.isDead = true; ExplosionManager.GetBombExplosion(this.pBomb); DelayRemoveManager.Attach(new RemoveBombObserver(this)); } }
static public void RemoveAll() { DelayRemoveManager pMan = DelayRemoveManager.PrivGetInstance(); CollisionObservers pNode = pMan.head; CollisionObservers pTmp = null; while (pNode != null) { pTmp = pNode; pNode = (CollisionObservers)pNode.pNext; pMan.PrivDetach(pTmp, ref pMan.head); } }
public override void Notify() { if (this.IsValidCollision()) { if (this.pAlien.isDead == false) { SoundManager.Play(Sound.Name.AlienExplode); this.pAlien.isDead = true; ExplosionManager.GetAlienExplosion(this.pAlien); DelayRemoveManager.Attach(new RemoveAlienObserver(this)); } } }
public override void Notify() { if (this.IsValidCollision()) { if (this.pMissile.isDead == false) { Player pPlayer = PlayerManager.GetPlayer(); Debug.Assert(pPlayer != null); pPlayer.SetShootingState(PlayerManager.ShootState.MissileReady); this.pMissile.isDead = true; this.pMissile.SetFlyingStatus(false); DelayRemoveManager.Attach(new RemoveMissileObserver(this)); } } }
static public void Attach(CollisionObservers pObs) { Debug.Assert(pObs != null); DelayRemoveManager pMan = DelayRemoveManager.PrivGetInstance(); if (pMan.head == null) { pMan.head = pObs; pObs.pNext = null; pObs.pPrev = null; } else { pObs.pNext = pMan.head; pObs.pPrev = null; pMan.head.pPrev = pObs; pMan.head = pObs; } }