public Unit findNewTargetInCurrentRoom() {
    Unit new_target = null;
    double smallest_angle_to_target = max_angle_to_target;
    switch (target_type) {
      case PYRO:
        for (Pyro pyro : current_room.getPyros()) {
          if (!pyro.isHomable()) {
            continue;
          }
          double abs_angle_to_target = Math.abs(MapUtils.angleTo(bound_object, pyro));
          if (abs_angle_to_target < smallest_angle_to_target) {
            new_target = pyro;
            smallest_angle_to_target = abs_angle_to_target;
          }
        }
        break;
      case ROBOT:
        for (Robot robot : current_room.getRobots()) {
          if (!robot.isHomable()) {
            continue;
          }
          double abs_angle_to_target = Math.abs(MapUtils.angleTo(bound_object, robot));
          if (abs_angle_to_target < smallest_angle_to_target) {
            new_target = robot;
            smallest_angle_to_target = abs_angle_to_target;
          }
        }
        break;
      default:
        throw new DescentMapException("Unexpected HomingTargetType: " + target_type);
    }
    return new_target;
  }