@Test public void testGetAllGunDataOne() { GunDataManager gdm = newGunDataManager(); gdm.newEnemy(_shadowSre, _enemyLocation, 0, 1, true); Collection<GunEnemy> allGunData = gdm.getAllEnemyData(); assertEquals(1, allGunData.size()); assertEquals("Shadow", allGunData.iterator().next().botName); }
public GunEnemy newEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation, double absBearing, int currentRound, boolean is1v1) { if (hasEnemy(e.getName())) { throw new IllegalArgumentException( "GunEnemy already exists for bot: " + e.getName()); } GunEnemy gunData = new GunEnemy(e.getName(), e.getDistance(), e.getEnergy(), enemyLocation, currentRound, e.getTime(), e.getHeadingRadians(), e.getVelocity(), absBearing, _battleField, _predictor, _renderables); gunData.updateTimers(e.getVelocity()); saveEnemy(e.getName(), gunData); if (is1v1) { _duelEnemy = gunData; } return gunData; }
GunDataManager extends EnemyDataManager<GunEnemy> { public GunEnemy newEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation, double absBearing, int currentRound, boolean is1v1) { if (hasEnemy(e.getName())) { throw new IllegalArgumentException( "GunEnemy already exists for bot: " + e.getName()); } GunEnemy gunData = new GunEnemy(e.getName(), e.getDistance(), e.getEnergy(), enemyLocation, currentRound, e.getTime(), e.getHeadingRadians(), e.getVelocity(), absBearing, _battleField, _predictor, _renderables); gunData.updateTimers(e.getVelocity()); saveEnemy(e.getName(), gunData); if (is1v1) { _duelEnemy = gunData; } return gunData; } }
GunDataManager extends EnemyDataManager<GunEnemy> { public GunEnemy newEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation, double absBearing, int currentRound, boolean is1v1) { if (hasEnemy(e.getName())) { throw new IllegalArgumentException( "GunEnemy already exists for bot: " + e.getName()); } GunEnemy gunData = new GunEnemy(e.getName(), e.getDistance(), e.getEnergy(), enemyLocation, currentRound, e.getTime(), e.getHeadingRadians(), e.getVelocity(), absBearing, _battleField, _predictor, _renderables); gunData.updateTimers(e.getVelocity()); saveEnemy(e.getName(), gunData); if (is1v1) { _duelEnemy = gunData; } return gunData; } GunDataManager(int enemiesTotal, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables,
      OutputStream out); }
GunDataManager extends EnemyDataManager<GunEnemy> { public GunEnemy newEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation, double absBearing, int currentRound, boolean is1v1) { if (hasEnemy(e.getName())) { throw new IllegalArgumentException( "GunEnemy already exists for bot: " + e.getName()); } GunEnemy gunData = new GunEnemy(e.getName(), e.getDistance(), e.getEnergy(), enemyLocation, currentRound, e.getTime(), e.getHeadingRadians(), e.getVelocity(), absBearing, _battleField, _predictor, _renderables); gunData.updateTimers(e.getVelocity()); saveEnemy(e.getName(), gunData); if (is1v1) { _duelEnemy = gunData; } return gunData; } GunDataManager(int enemiesTotal, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables,
      OutputStream out); @Override void initRound(); void execute(int currentRound, long currentTime, double bulletPower,
      double currentGunHeat, Point2D.Double myLocation, boolean is1v1,
      boolean painting); GunEnemy newEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation,
      double absBearing, int currentRound, boolean is1v1); GunEnemy updateEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation,
      double absBearing, int currentRound, boolean is1v1); void onBulletHit(BulletHitEvent e, long currentTime); void onBulletHitBullet(BulletHitBulletEvent e, long currentTime); double getDamageGiven(); double getAverageEnergy(); void markFiringWaves(long currentTime, boolean is1v1); void fireNextTickWave(Point2D.Double myNextLocation,
      Point2D.Double targetLocation, String targetName, int currentRound,
      long currentTime, double bulletPower, double myEnergy, double gunHeat,
      double myHeading, double myVelocity, int enemiesAlive); void addListener(GunDataListener listener); int getEnemiesTotal(); int getDuelDataSize(); void drawVictory(long startTime); }
GunDataManager extends EnemyDataManager<GunEnemy> { public GunEnemy newEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation, double absBearing, int currentRound, boolean is1v1) { if (hasEnemy(e.getName())) { throw new IllegalArgumentException( "GunEnemy already exists for bot: " + e.getName()); } GunEnemy gunData = new GunEnemy(e.getName(), e.getDistance(), e.getEnergy(), enemyLocation, currentRound, e.getTime(), e.getHeadingRadians(), e.getVelocity(), absBearing, _battleField, _predictor, _renderables); gunData.updateTimers(e.getVelocity()); saveEnemy(e.getName(), gunData); if (is1v1) { _duelEnemy = gunData; } return gunData; } GunDataManager(int enemiesTotal, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables,
      OutputStream out); @Override void initRound(); void execute(int currentRound, long currentTime, double bulletPower,
      double currentGunHeat, Point2D.Double myLocation, boolean is1v1,
      boolean painting); GunEnemy newEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation,
      double absBearing, int currentRound, boolean is1v1); GunEnemy updateEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation,
      double absBearing, int currentRound, boolean is1v1); void onBulletHit(BulletHitEvent e, long currentTime); void onBulletHitBullet(BulletHitBulletEvent e, long currentTime); double getDamageGiven(); double getAverageEnergy(); void markFiringWaves(long currentTime, boolean is1v1); void fireNextTickWave(Point2D.Double myNextLocation,
      Point2D.Double targetLocation, String targetName, int currentRound,
      long currentTime, double bulletPower, double myEnergy, double gunHeat,
      double myHeading, double myVelocity, int enemiesAlive); void addListener(GunDataListener listener); int getEnemiesTotal(); int getDuelDataSize(); void drawVictory(long startTime);  }