@Test public void testUpdate() { WorldObject worldObject = mock(WorldObject.class); when(worldObject.getVector2D()).thenReturn(Vector2D.ORIGIN); World world = WorldUtils.createDefaultWorld(); world.getWorldObjects().add(worldObject); world.update(); verify(worldObject, times(1)).preUpdate(); verify(worldObject, times(1)).update(); verify(worldObject, times(1)).postUpdate(); }
public void update() { lastUpdateStarted = System.currentTimeMillis(); synchronized (worldObjects) { worldObjects.refresh(); worldObjects.forEach(WorldObject::preUpdate); worldObjects.forEach(WorldObject::update); worldObjects.forEach(WorldObject::postUpdate); } lastUpdateCompleted = System.currentTimeMillis(); }
World { public void update() { lastUpdateStarted = System.currentTimeMillis(); synchronized (worldObjects) { worldObjects.refresh(); worldObjects.forEach(WorldObject::preUpdate); worldObjects.forEach(WorldObject::update); worldObjects.forEach(WorldObject::postUpdate); } lastUpdateCompleted = System.currentTimeMillis(); } }
World { public void update() { lastUpdateStarted = System.currentTimeMillis(); synchronized (worldObjects) { worldObjects.refresh(); worldObjects.forEach(WorldObject::preUpdate); worldObjects.forEach(WorldObject::update); worldObjects.forEach(WorldObject::postUpdate); } lastUpdateCompleted = System.currentTimeMillis(); } World();  World(Zone... zones); }
World { public void update() { lastUpdateStarted = System.currentTimeMillis(); synchronized (worldObjects) { worldObjects.refresh(); worldObjects.forEach(WorldObject::preUpdate); worldObjects.forEach(WorldObject::update); worldObjects.forEach(WorldObject::postUpdate); } lastUpdateCompleted = System.currentTimeMillis(); } World();  World(Zone... zones); WorldObjectList getWorldObjects(); void update(); Map<Integer, Zone> getZones(); long getLastUpdateCompleted(); long getLastUpdateStarted(); }
World { public void update() { lastUpdateStarted = System.currentTimeMillis(); synchronized (worldObjects) { worldObjects.refresh(); worldObjects.forEach(WorldObject::preUpdate); worldObjects.forEach(WorldObject::update); worldObjects.forEach(WorldObject::postUpdate); } lastUpdateCompleted = System.currentTimeMillis(); } World();  World(Zone... zones); WorldObjectList getWorldObjects(); void update(); Map<Integer, Zone> getZones(); long getLastUpdateCompleted(); long getLastUpdateStarted();  }