@Test public void testNewGunWaveAltWave() { GunEnemy gunData = newGunEnemy("Shadow"); java.awt.geom.Point2D.Double myLocation = newLocation(100, 100); Wave w = gunData.newGunWave(myLocation, gunData.lastScanState.location, 1, 100, 87, 1.9, 100.0, 0.1, 4, 0.22, 54, 104, 204, true); assertEquals(true, w.altWave); }
public Wave newGunWave(Point2D.Double sourceLocation, Point2D.Double targetLocation, int fireRound, long fireTime, long lastBulletFiredTime, double bulletPower, double myEnergy, double gunHeat, int enemiesAlive, double accel, double dl8t, double dl20t, double dl40t, boolean altWave) { Wave newWave = new Wave(botName, sourceLocation, targetLocation, fireRound, fireTime, bulletPower, lastScanState.heading, lastScanState.velocity, DiaUtils.nonZeroSign(lastNonZeroVelocity), _battleField, _predictor) .setAccel(accel) .setDistance(sourceLocation.distance(targetLocation)) .setDchangeTime(timeSinceDirectionChange) .setVchangeTime(timeSinceVelocityChange) .setDistanceLast8Ticks(dl8t) .setDistanceLast20Ticks(dl20t) .setDistanceLast40Ticks(dl40t) .setTargetEnergy(energy) .setSourceEnergy(myEnergy) .setGunHeat(gunHeat) .setEnemiesAlive(enemiesAlive) .setLastBulletFiredTime(lastBulletFiredTime) .setAltWave(altWave); newWave.setWallDistances(enemiesAlive <= 1 ? Wave.WallDistanceStyle.ORBITAL : Wave.WallDistanceStyle.DIRECT); if (myEnergy > 0) { _waveManager.addWave(newWave); } return newWave; }
GunEnemy extends Enemy<TimestampedFiringAngle> { public Wave newGunWave(Point2D.Double sourceLocation, Point2D.Double targetLocation, int fireRound, long fireTime, long lastBulletFiredTime, double bulletPower, double myEnergy, double gunHeat, int enemiesAlive, double accel, double dl8t, double dl20t, double dl40t, boolean altWave) { Wave newWave = new Wave(botName, sourceLocation, targetLocation, fireRound, fireTime, bulletPower, lastScanState.heading, lastScanState.velocity, DiaUtils.nonZeroSign(lastNonZeroVelocity), _battleField, _predictor) .setAccel(accel) .setDistance(sourceLocation.distance(targetLocation)) .setDchangeTime(timeSinceDirectionChange) .setVchangeTime(timeSinceVelocityChange) .setDistanceLast8Ticks(dl8t) .setDistanceLast20Ticks(dl20t) .setDistanceLast40Ticks(dl40t) .setTargetEnergy(energy) .setSourceEnergy(myEnergy) .setGunHeat(gunHeat) .setEnemiesAlive(enemiesAlive) .setLastBulletFiredTime(lastBulletFiredTime) .setAltWave(altWave); newWave.setWallDistances(enemiesAlive <= 1 ? Wave.WallDistanceStyle.ORBITAL : Wave.WallDistanceStyle.DIRECT); if (myEnergy > 0) { _waveManager.addWave(newWave); } return newWave; } }
GunEnemy extends Enemy<TimestampedFiringAngle> { public Wave newGunWave(Point2D.Double sourceLocation, Point2D.Double targetLocation, int fireRound, long fireTime, long lastBulletFiredTime, double bulletPower, double myEnergy, double gunHeat, int enemiesAlive, double accel, double dl8t, double dl20t, double dl40t, boolean altWave) { Wave newWave = new Wave(botName, sourceLocation, targetLocation, fireRound, fireTime, bulletPower, lastScanState.heading, lastScanState.velocity, DiaUtils.nonZeroSign(lastNonZeroVelocity), _battleField, _predictor) .setAccel(accel) .setDistance(sourceLocation.distance(targetLocation)) .setDchangeTime(timeSinceDirectionChange) .setVchangeTime(timeSinceVelocityChange) .setDistanceLast8Ticks(dl8t) .setDistanceLast20Ticks(dl20t) .setDistanceLast40Ticks(dl40t) .setTargetEnergy(energy) .setSourceEnergy(myEnergy) .setGunHeat(gunHeat) .setEnemiesAlive(enemiesAlive) .setLastBulletFiredTime(lastBulletFiredTime) .setAltWave(altWave); newWave.setWallDistances(enemiesAlive <= 1 ? Wave.WallDistanceStyle.ORBITAL : Wave.WallDistanceStyle.DIRECT); if (myEnergy > 0) { _waveManager.addWave(newWave); } return newWave; } GunEnemy(String botName, double distance, double energy,
      Point2D.Double location, int round, long time, double heading,
      double velocity, double absBearing, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables);   GunEnemy(String botName, double distance, double energy,
      Point2D.Double location, int round, long time, double heading,
      double velocity, double absBearing, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables,
      WaveManager waveManager); }
GunEnemy extends Enemy<TimestampedFiringAngle> { public Wave newGunWave(Point2D.Double sourceLocation, Point2D.Double targetLocation, int fireRound, long fireTime, long lastBulletFiredTime, double bulletPower, double myEnergy, double gunHeat, int enemiesAlive, double accel, double dl8t, double dl20t, double dl40t, boolean altWave) { Wave newWave = new Wave(botName, sourceLocation, targetLocation, fireRound, fireTime, bulletPower, lastScanState.heading, lastScanState.velocity, DiaUtils.nonZeroSign(lastNonZeroVelocity), _battleField, _predictor) .setAccel(accel) .setDistance(sourceLocation.distance(targetLocation)) .setDchangeTime(timeSinceDirectionChange) .setVchangeTime(timeSinceVelocityChange) .setDistanceLast8Ticks(dl8t) .setDistanceLast20Ticks(dl20t) .setDistanceLast40Ticks(dl40t) .setTargetEnergy(energy) .setSourceEnergy(myEnergy) .setGunHeat(gunHeat) .setEnemiesAlive(enemiesAlive) .setLastBulletFiredTime(lastBulletFiredTime) .setAltWave(altWave); newWave.setWallDistances(enemiesAlive <= 1 ? Wave.WallDistanceStyle.ORBITAL : Wave.WallDistanceStyle.DIRECT); if (myEnergy > 0) { _waveManager.addWave(newWave); } return newWave; } GunEnemy(String botName, double distance, double energy,
      Point2D.Double location, int round, long time, double heading,
      double velocity, double absBearing, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables);   GunEnemy(String botName, double distance, double energy,
      Point2D.Double location, int round, long time, double heading,
      double velocity, double absBearing, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables,
      WaveManager waveManager); @Override void initRound(); void execute(final long currentTime, long lastBulletFiredTime,
      double bulletPower, double currentGunHeat, Point2D.Double myLocation,
      final boolean is1v1, final int enemiesTotal,
      final List<GunDataListener> gunDataListeners, final boolean painting); Wave processBulletHit(Bullet bullet, long currentTime,
      boolean is1v1Battle, boolean logHitWave); void logBulletHitLocation(Bullet bullet); Wave newGunWave(Point2D.Double sourceLocation,
      Point2D.Double targetLocation, int fireRound, long fireTime,
      long lastBulletFiredTime, double bulletPower, double myEnergy,
      double gunHeat, int enemiesAlive, double accel, double dl8t, double dl20t,
      double dl40t, boolean altWave); void markFiringWaves(
      long currentTime, boolean is1v1, List<GunDataListener> gunDataListeners); Wave findSurfableWave(Wave aimWave, int surfIndex); void updateTimers(double velocity); long getLastWaveFireTime(String botName); Wave interpolateGunWave(long fireTime, long currentTime,
      double myHeading, double myVelocity, RobotState enemyState); double advancingVelocity(); boolean isRammer(); int getWaveBreaks(); }
GunEnemy extends Enemy<TimestampedFiringAngle> { public Wave newGunWave(Point2D.Double sourceLocation, Point2D.Double targetLocation, int fireRound, long fireTime, long lastBulletFiredTime, double bulletPower, double myEnergy, double gunHeat, int enemiesAlive, double accel, double dl8t, double dl20t, double dl40t, boolean altWave) { Wave newWave = new Wave(botName, sourceLocation, targetLocation, fireRound, fireTime, bulletPower, lastScanState.heading, lastScanState.velocity, DiaUtils.nonZeroSign(lastNonZeroVelocity), _battleField, _predictor) .setAccel(accel) .setDistance(sourceLocation.distance(targetLocation)) .setDchangeTime(timeSinceDirectionChange) .setVchangeTime(timeSinceVelocityChange) .setDistanceLast8Ticks(dl8t) .setDistanceLast20Ticks(dl20t) .setDistanceLast40Ticks(dl40t) .setTargetEnergy(energy) .setSourceEnergy(myEnergy) .setGunHeat(gunHeat) .setEnemiesAlive(enemiesAlive) .setLastBulletFiredTime(lastBulletFiredTime) .setAltWave(altWave); newWave.setWallDistances(enemiesAlive <= 1 ? Wave.WallDistanceStyle.ORBITAL : Wave.WallDistanceStyle.DIRECT); if (myEnergy > 0) { _waveManager.addWave(newWave); } return newWave; } GunEnemy(String botName, double distance, double energy,
      Point2D.Double location, int round, long time, double heading,
      double velocity, double absBearing, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables);   GunEnemy(String botName, double distance, double energy,
      Point2D.Double location, int round, long time, double heading,
      double velocity, double absBearing, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables,
      WaveManager waveManager); @Override void initRound(); void execute(final long currentTime, long lastBulletFiredTime,
      double bulletPower, double currentGunHeat, Point2D.Double myLocation,
      final boolean is1v1, final int enemiesTotal,
      final List<GunDataListener> gunDataListeners, final boolean painting); Wave processBulletHit(Bullet bullet, long currentTime,
      boolean is1v1Battle, boolean logHitWave); void logBulletHitLocation(Bullet bullet); Wave newGunWave(Point2D.Double sourceLocation,
      Point2D.Double targetLocation, int fireRound, long fireTime,
      long lastBulletFiredTime, double bulletPower, double myEnergy,
      double gunHeat, int enemiesAlive, double accel, double dl8t, double dl20t,
      double dl40t, boolean altWave); void markFiringWaves(
      long currentTime, boolean is1v1, List<GunDataListener> gunDataListeners); Wave findSurfableWave(Wave aimWave, int surfIndex); void updateTimers(double velocity); long getLastWaveFireTime(String botName); Wave interpolateGunWave(long fireTime, long currentTime,
      double myHeading, double myVelocity, RobotState enemyState); double advancingVelocity(); boolean isRammer(); int getWaveBreaks(); public double previousVelocity; public double lastNonZeroVelocity; public long timeSinceDirectionChange; public long timeSinceVelocityChange; public long timeMovingAtMe; public Wave lastWaveFired; public List<Point2D.Double> hitLocations; }