@Test public void testOnBulletHitBulletUnknownEnemy() { MoveDataManager manager = newMoveDataManager(); manager.onBulletHitBullet( _eventHelper.newBulletHitBulletEvent("Shadow", 3.0, "Portia", 1.9), 1, 50L, false); assertTrue(_out.toString().contains(WARNING_BULLET_HIT_BULLET_UNKNOWN)); }
public void onBulletHitBullet(BulletHitBulletEvent e, int currentRound, long currentTime, boolean painting) { String botName = e.getHitBullet().getName(); if (hasEnemy(botName)) { MoveEnemy moveData = getEnemyData(botName); Wave hitWave = moveData.processBullet( e.getHitBullet(), currentRound, currentTime, painting); if (hitWave != null) { hitWave.bulletHitBullet = true; } } else if (!botName.equals(e.getBullet().getName())) { _out.println(warning() + "One of my bullets hit a bullet from a " + "bot that I never knew existed! (" + botName + ")"); } removeFiredBullet(e); if (_duelEnemy != null) { _duelEnemy.resetBulletShadows(_firedBullets); _duelEnemy.clearNeighborCache(); } }
MoveDataManager extends EnemyDataManager<MoveEnemy> { public void onBulletHitBullet(BulletHitBulletEvent e, int currentRound, long currentTime, boolean painting) { String botName = e.getHitBullet().getName(); if (hasEnemy(botName)) { MoveEnemy moveData = getEnemyData(botName); Wave hitWave = moveData.processBullet( e.getHitBullet(), currentRound, currentTime, painting); if (hitWave != null) { hitWave.bulletHitBullet = true; } } else if (!botName.equals(e.getBullet().getName())) { _out.println(warning() + "One of my bullets hit a bullet from a " + "bot that I never knew existed! (" + botName + ")"); } removeFiredBullet(e); if (_duelEnemy != null) { _duelEnemy.resetBulletShadows(_firedBullets); _duelEnemy.clearNeighborCache(); } } }
MoveDataManager extends EnemyDataManager<MoveEnemy> { public void onBulletHitBullet(BulletHitBulletEvent e, int currentRound, long currentTime, boolean painting) { String botName = e.getHitBullet().getName(); if (hasEnemy(botName)) { MoveEnemy moveData = getEnemyData(botName); Wave hitWave = moveData.processBullet( e.getHitBullet(), currentRound, currentTime, painting); if (hitWave != null) { hitWave.bulletHitBullet = true; } } else if (!botName.equals(e.getBullet().getName())) { _out.println(warning() + "One of my bullets hit a bullet from a " + "bot that I never knew existed! (" + botName + ")"); } removeFiredBullet(e); if (_duelEnemy != null) { _duelEnemy.resetBulletShadows(_firedBullets); _duelEnemy.clearNeighborCache(); } } protected  MoveDataManager(int enemiesTotal, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables,
      OutputStream out); }
MoveDataManager extends EnemyDataManager<MoveEnemy> { public void onBulletHitBullet(BulletHitBulletEvent e, int currentRound, long currentTime, boolean painting) { String botName = e.getHitBullet().getName(); if (hasEnemy(botName)) { MoveEnemy moveData = getEnemyData(botName); Wave hitWave = moveData.processBullet( e.getHitBullet(), currentRound, currentTime, painting); if (hitWave != null) { hitWave.bulletHitBullet = true; } } else if (!botName.equals(e.getBullet().getName())) { _out.println(warning() + "One of my bullets hit a bullet from a " + "bot that I never knew existed! (" + botName + ")"); } removeFiredBullet(e); if (_duelEnemy != null) { _duelEnemy.resetBulletShadows(_firedBullets); _duelEnemy.clearNeighborCache(); } } protected  MoveDataManager(int enemiesTotal, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables,
      OutputStream out); void execute(int round, long time, Point2D.Double myLocation,
      double heading, double velocity); @Override void initRound(); MoveEnemy newEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation,
      double absBearing, int currentRound, boolean is1v1); MoveEnemy updateEnemy(ScannedRobotEvent e,
      Point2D.Double enemyLocation, double absBearing, int currentRound,
      boolean is1v1); void onHitByBullet(HitByBulletEvent e, int currentRound,
      long currentTime, boolean painting); void onBulletHitBullet(BulletHitBulletEvent e, int currentRound,
      long currentTime, boolean painting); void onBulletHit(BulletHitEvent e); void updateEnemyWaves(Point2D.Double myLocation,
      double previousEnemyEnergy, String botName, int currentRound,
      long currentTime, double myEnergy, double myHeading, double myVelocity,
      int wavesToSurf); RobotStateLog myStateLog(); void addFiredBullet(FiredBullet bullet); }
MoveDataManager extends EnemyDataManager<MoveEnemy> { public void onBulletHitBullet(BulletHitBulletEvent e, int currentRound, long currentTime, boolean painting) { String botName = e.getHitBullet().getName(); if (hasEnemy(botName)) { MoveEnemy moveData = getEnemyData(botName); Wave hitWave = moveData.processBullet( e.getHitBullet(), currentRound, currentTime, painting); if (hitWave != null) { hitWave.bulletHitBullet = true; } } else if (!botName.equals(e.getBullet().getName())) { _out.println(warning() + "One of my bullets hit a bullet from a " + "bot that I never knew existed! (" + botName + ")"); } removeFiredBullet(e); if (_duelEnemy != null) { _duelEnemy.resetBulletShadows(_firedBullets); _duelEnemy.clearNeighborCache(); } } protected  MoveDataManager(int enemiesTotal, BattleField battleField,
      MovementPredictor predictor, Collection<RoboGraphic> renderables,
      OutputStream out); void execute(int round, long time, Point2D.Double myLocation,
      double heading, double velocity); @Override void initRound(); MoveEnemy newEnemy(ScannedRobotEvent e, Point2D.Double enemyLocation,
      double absBearing, int currentRound, boolean is1v1); MoveEnemy updateEnemy(ScannedRobotEvent e,
      Point2D.Double enemyLocation, double absBearing, int currentRound,
      boolean is1v1); void onHitByBullet(HitByBulletEvent e, int currentRound,
      long currentTime, boolean painting); void onBulletHitBullet(BulletHitBulletEvent e, int currentRound,
      long currentTime, boolean painting); void onBulletHit(BulletHitEvent e); void updateEnemyWaves(Point2D.Double myLocation,
      double previousEnemyEnergy, String botName, int currentRound,
      long currentTime, double myEnergy, double myHeading, double myVelocity,
      int wavesToSurf); RobotStateLog myStateLog(); void addFiredBullet(FiredBullet bullet);  }