public ShipWeaponController(Ship ship, BulletManager bm) { _bulletManager = bm; _me = ship; Energy = 1; DamageModifier = 1; LastFired = DateTime.UtcNow; AutoFire = false; }
public GameHandler(Map space) { BulletManager = new BulletManager(); _collisionManager = new CollisionManager(space); _shipManager = new ShipManager(this); _powerupManager = new PowerupManager(); _space = space; }
public ShipAI(Vector2 position, BulletManager bulletManager) : base(position, bulletManager) { _state = AIState.Wandering; MovementController.Rotation = _gen.Next(0, 360); StatRecorder = new AIShipStatRecorder(this); SeekingShip = -1; Name = "CPU" + ID; LevelManager.OnLevel += CheckReset; }
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); }