Search in sources :

Example 1 with RecordingEventSystemDecorator

use of org.terasology.engine.recording.RecordingEventSystemDecorator in project Terasology by MovingBlocks.

the class EntitySystemSetupUtil method createEventSystem.

private static EventSystem createEventSystem(NetworkSystem networkSystem, PojoEntityManager entityManager, EntitySystemLibrary library, RecordedEventStore recordedEventStore, RecordAndReplaySerializer recordAndReplaySerializer, RecordAndReplayUtils recordAndReplayUtils, RecordAndReplayCurrentStatus recordAndReplayCurrentStatus) {
    EventSystem eventSystem;
    List<Class<?>> selectedClassesToRecord = createSelectedClassesToRecordList();
    if (recordAndReplayCurrentStatus.getStatus() == RecordAndReplayStatus.PREPARING_REPLAY) {
        eventSystem = new EventSystemReplayImpl(library.getEventLibrary(), networkSystem, entityManager, recordedEventStore, recordAndReplaySerializer, recordAndReplayUtils, selectedClassesToRecord, recordAndReplayCurrentStatus);
    } else {
        EventCatcher eventCatcher = new EventCatcher(selectedClassesToRecord, recordedEventStore);
        eventSystem = new EventSystemImpl(networkSystem.getMode().isAuthority());
        eventSystem = new NetworkEventSystemDecorator(eventSystem, networkSystem, library.getEventLibrary());
        eventSystem = new RecordingEventSystemDecorator(eventSystem, eventCatcher, recordAndReplayCurrentStatus);
    }
    return eventSystem;
}
Also used : EventCatcher(org.terasology.engine.recording.EventCatcher) NetworkEventSystemDecorator(org.terasology.engine.network.NetworkEventSystemDecorator) EventSystemReplayImpl(org.terasology.engine.recording.EventSystemReplayImpl) RecordingEventSystemDecorator(org.terasology.engine.recording.RecordingEventSystemDecorator) EventSystem(org.terasology.engine.entitySystem.event.internal.EventSystem) EventSystemImpl(org.terasology.engine.entitySystem.event.internal.EventSystemImpl)

Aggregations

EventSystem (org.terasology.engine.entitySystem.event.internal.EventSystem)1 EventSystemImpl (org.terasology.engine.entitySystem.event.internal.EventSystemImpl)1 NetworkEventSystemDecorator (org.terasology.engine.network.NetworkEventSystemDecorator)1 EventCatcher (org.terasology.engine.recording.EventCatcher)1 EventSystemReplayImpl (org.terasology.engine.recording.EventSystemReplayImpl)1 RecordingEventSystemDecorator (org.terasology.engine.recording.RecordingEventSystemDecorator)1