protected virtual void OnCharacterDead(DeathEventArgs e)
        {
            DeathEventHandler handler = IsDead;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Example #2
0
        public Balancing(TestMobile m1, TestMobile m2)
        {
            m1.Balance   = this;
            m2.Balance   = this;
            mob1         = m1;
            mob2         = m2;
            fileLocation = null;

            Death += new DeathEventHandler(EventSink_Death);

            StartCombat();
            new FinishTimer(this).Start();
        }
Example #3
0
        public Ship(Vector2 position, BulletManager bm)
            : base(WIDTH, HEIGHT, new ShipMovementController(position), new ShipLifeController(START_LIFE), new HarmlessDamageController())
        {
            ID                      = Interlocked.Increment(ref _shipGUID);
            Name                    = "Ship" + ID;
            StatRecorder            = new ShipStatRecorder(this);
            WeaponController        = new ShipWeaponController(this, bm);
            LifeController.OnDeath += new DeathEventHandler(Die);
            OnDeath                += new DeathEventHandler((sender, e) => StatRecorder.ShipDeath(sender, e)); // layer of indirection required since 'StatRecorder' is vurtla and may be changed by subclassed types
            LifeController.Host     = this;

            LevelManager   = new ShipLevelManager(this);
            AbilityHandler = new ShipAbilityHandler(this);
        }
Example #4
0
        public Ship(Vector2 position, BulletManager bm)
            : base(WIDTH, HEIGHT, new ShipMovementController(position), new ShipLifeController(START_LIFE), new HarmlessDamageController())
        {
            ID = Interlocked.Increment(ref _shipGUID);
            Name = "Ship" + ID;
            StatRecorder = new ShipStatRecorder(this);
            WeaponController = new ShipWeaponController(this, bm);
            LifeController.OnDeath += new DeathEventHandler(Die);
            OnDeath += new DeathEventHandler((sender, e) => StatRecorder.ShipDeath(sender, e)); // layer of indirection required since 'StatRecorder' is vurtla and may be changed by subclassed types
            LifeController.Host = this;

            LevelManager = new ShipLevelManager(this);
            AbilityHandler = new ShipAbilityHandler(this);
        }