예제 #1
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);
        }
예제 #2
0
파일: Ship.cs 프로젝트: AbhiLegend/ShootR
        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);
        }