public override void Notify() { //Debug.WriteLine("RemoveBombObserver: {0} {1}", this.pSubject.pObjA, this.pSubject.pObjB); this.pBomb = (Bomb)this.pSubject.pObjA; this.pShip = (Ship)this.pSubject.pObjB; Debug.Assert(this.pBomb != null); Debug.Assert(this.pShip != null); if (pShip.bMarkForDeath == false) { pShip.bMarkForDeath = true; // Delay ShipTakeDamageObserver pObserver = new ShipTakeDamageObserver(this); DelayedObjectManager.Attach(pObserver); } else { pShip.bMarkForDeath = true; } }
public ShipTakeDamageObserver(ShipTakeDamageObserver pObserver) { this.pBomb = pObserver.pBomb; this.pShip = pObserver.pShip; }