public void Configure(IInputAdapter typeOfInput, ProjectileId defaultProjectile, Vector2 speed, float fireRatio)
 {
     movementController.Configure(this, speed);
     weaponController.Configure(this, defaultProjectile, fireRatio);
     _inputAdapter = typeOfInput;
     isConfigure   = true;
 }
示例#2
0
 public void Configure(IShip ship, ProjectileId defaultProjectile, float fireRatio)
 {
     defauldProjectile   = defaultProjectile;
     concurrentProjectil = defauldProjectile;
     this.ship           = ship;
     fireRateInSeconds   = fireRatio;
     fireRateDeltaTime   = fireRateInSeconds;
     isConfigurated      = true;
     factoryProjectiles  = new FactoryProjectiles(Instantiate(factoryProjectilesConfiguration));
 }
        public IProjectile Spawn(ProjectileId id, Vector2f position, Vector2f velocity, int damage, float knockback)
        {
            Log.Debug("Spawning {ProjectileId} at {Position}", id, position);

            lock (_lock)
            {
                var projectileIndex = Terraria.Projectile.NewProjectile(
                    position.X, position.Y, velocity.X, velocity.Y, (int)id, damage, knockback);
                Debug.Assert(projectileIndex >= 0 && projectileIndex < Count);

                return(this[projectileIndex]);
            }
        }
示例#4
0
 public ShipBuilder WithPrefabProjectile(ProjectileId projectileId)
 {
     _projectileId = projectileId;
     return(this);
 }