use of org.terasology.entitySystem.systems.UpdateSubscriberSystem in project Terasology by MovingBlocks.
the class StateIngame method update.
@Override
public void update(float delta) {
eventSystem.process();
for (UpdateSubscriberSystem system : componentSystemManager.iterateUpdateSubscribers()) {
PerformanceMonitor.startActivity(system.getClass().getSimpleName());
system.update(delta);
PerformanceMonitor.endActivity();
}
if (worldRenderer != null && shouldUpdateWorld()) {
worldRenderer.update(delta);
}
if (storageManager != null) {
storageManager.update();
}
updateUserInterface(delta);
storageServiceWorker.flushNotificationsToConsole(console);
}
use of org.terasology.entitySystem.systems.UpdateSubscriberSystem in project Terasology by MovingBlocks.
the class AwaitCharacterSpawn method step.
@Override
public boolean step() {
ComponentSystemManager componentSystemManager = context.get(ComponentSystemManager.class);
for (UpdateSubscriberSystem updater : componentSystemManager.iterateUpdateSubscribers()) {
updater.update(0.0f);
}
LocalPlayer localPlayer = context.get(LocalPlayer.class);
ClientComponent client = localPlayer.getClientEntity().getComponent(ClientComponent.class);
if (client != null && client.character.exists()) {
client.character.send(new AwaitedLocalCharacterSpawnEvent());
return true;
} else {
chunkProvider.completeUpdate();
chunkProvider.beginUpdate();
}
return false;
}
use of org.terasology.entitySystem.systems.UpdateSubscriberSystem in project Terasology by MovingBlocks.
the class ComponentSystemManagerTest method testRegisterUpdateSubscriberAddsSubscriber.
@Test
public void testRegisterUpdateSubscriberAddsSubscriber() {
UpdateSubscriberSystem system = mock(UpdateSubscriberSystem.class);
systemUnderTest.register(system);
assertThat(Iterables.size(systemUnderTest.iterateUpdateSubscribers()), is(1));
}
use of org.terasology.entitySystem.systems.UpdateSubscriberSystem in project Terasology by MovingBlocks.
the class ComponentSystemManagerTest method testShutdownRemovesUpdateSubscribers.
@Test
public void testShutdownRemovesUpdateSubscribers() {
UpdateSubscriberSystem system = mock(UpdateSubscriberSystem.class);
systemUnderTest.register(system);
systemUnderTest.shutdown();
assertThat(Iterables.size(systemUnderTest.iterateUpdateSubscribers()), is(0));
}
Aggregations