@Test public void getTickTime() throws Exception { Assert.assertEquals(Settings.TICK_TIME, Settings.getTickTime(ChronoUnit.MILLIS), 0.1); Assert.assertEquals(Settings.TICK_TIME / 1000, Settings.getTickTime(ChronoUnit.SECONDS), 0.1); Assert.assertEquals(Settings.TICK_TIME * 1000, Settings.getTickTime(ChronoUnit.MICROS), 0.1); }
public static double getTickTime(ChronoUnit temporalUnit) { switch (temporalUnit) { case NANOS: return getTickTime(ChronoUnit.MICROS) * 1000d; case MICROS: return getTickTime(ChronoUnit.MILLIS) * 1000d; case MILLIS: return TICK_TIME; case SECONDS: return getTickTime(ChronoUnit.MILLIS) / 1000d; case MINUTES: return getTickTime(ChronoUnit.SECONDS) / 60d; case HOURS: return getTickTime(ChronoUnit.MINUTES) / 60d; default: throw new IllegalArgumentException(temporalUnit.name() + " is not (yet) supported"); } }
Settings { public static double getTickTime(ChronoUnit temporalUnit) { switch (temporalUnit) { case NANOS: return getTickTime(ChronoUnit.MICROS) * 1000d; case MICROS: return getTickTime(ChronoUnit.MILLIS) * 1000d; case MILLIS: return TICK_TIME; case SECONDS: return getTickTime(ChronoUnit.MILLIS) / 1000d; case MINUTES: return getTickTime(ChronoUnit.SECONDS) / 60d; case HOURS: return getTickTime(ChronoUnit.MINUTES) / 60d; default: throw new IllegalArgumentException(temporalUnit.name() + " is not (yet) supported"); } } }
Settings { public static double getTickTime(ChronoUnit temporalUnit) { switch (temporalUnit) { case NANOS: return getTickTime(ChronoUnit.MICROS) * 1000d; case MICROS: return getTickTime(ChronoUnit.MILLIS) * 1000d; case MILLIS: return TICK_TIME; case SECONDS: return getTickTime(ChronoUnit.MILLIS) / 1000d; case MINUTES: return getTickTime(ChronoUnit.SECONDS) / 60d; case HOURS: return getTickTime(ChronoUnit.MINUTES) / 60d; default: throw new IllegalArgumentException(temporalUnit.name() + " is not (yet) supported"); } } private  Settings(); }
Settings { public static double getTickTime(ChronoUnit temporalUnit) { switch (temporalUnit) { case NANOS: return getTickTime(ChronoUnit.MICROS) * 1000d; case MICROS: return getTickTime(ChronoUnit.MILLIS) * 1000d; case MILLIS: return TICK_TIME; case SECONDS: return getTickTime(ChronoUnit.MILLIS) / 1000d; case MINUTES: return getTickTime(ChronoUnit.SECONDS) / 60d; case HOURS: return getTickTime(ChronoUnit.MINUTES) / 60d; default: throw new IllegalArgumentException(temporalUnit.name() + " is not (yet) supported"); } } private  Settings(); static double getTickTime(ChronoUnit temporalUnit); }
Settings { public static double getTickTime(ChronoUnit temporalUnit) { switch (temporalUnit) { case NANOS: return getTickTime(ChronoUnit.MICROS) * 1000d; case MICROS: return getTickTime(ChronoUnit.MILLIS) * 1000d; case MILLIS: return TICK_TIME; case SECONDS: return getTickTime(ChronoUnit.MILLIS) / 1000d; case MINUTES: return getTickTime(ChronoUnit.SECONDS) / 60d; case HOURS: return getTickTime(ChronoUnit.MINUTES) / 60d; default: throw new IllegalArgumentException(temporalUnit.name() + " is not (yet) supported"); } } private  Settings(); static double getTickTime(ChronoUnit temporalUnit); static final String ETCD_HOST; static final String ETCD_PORT; static final double ARENA_HEIGHT; static final double ARENA_DEPTH; static final double ARENA_WIDTH; static final D3Vector ARENA; static final GameMode GAME_MODE; static final long TICK_TIME; static final double MAX_DRONE_ACCELERATION; static final double MAX_DRONE_VELOCITY; }