Search in sources :

Example 6 with EntitySystemLibrary

use of org.terasology.engine.entitySystem.metadata.EntitySystemLibrary in project Terasology by MovingBlocks.

the class EntitySystemSetupUtil method addReflectionBasedLibraries.

public static void addReflectionBasedLibraries(Context context) {
    ReflectionReflectFactory reflectFactory = new ReflectionReflectFactory();
    context.put(ReflectFactory.class, reflectFactory);
    CopyStrategyLibrary copyStrategyLibrary = new CopyStrategyLibrary(reflectFactory);
    context.put(CopyStrategyLibrary.class, copyStrategyLibrary);
    ModuleManager moduleManager = context.get(ModuleManager.class);
    TypeRegistry typeRegistry = context.get(TypeRegistry.class);
    TypeHandlerLibrary typeHandlerLibrary = TypeHandlerLibraryImpl.forModuleEnvironment(moduleManager, typeRegistry);
    context.put(TypeHandlerLibrary.class, typeHandlerLibrary);
    EntitySystemLibrary library = new EntitySystemLibrary(context, typeHandlerLibrary);
    context.put(EntitySystemLibrary.class, library);
    context.put(ComponentLibrary.class, library.getComponentLibrary());
    context.put(EventLibrary.class, library.getEventLibrary());
}
Also used : ReflectionReflectFactory(org.terasology.reflection.reflect.ReflectionReflectFactory) TypeHandlerLibrary(org.terasology.persistence.typeHandling.TypeHandlerLibrary) EntitySystemLibrary(org.terasology.engine.entitySystem.metadata.EntitySystemLibrary) CopyStrategyLibrary(org.terasology.reflection.copy.CopyStrategyLibrary) ModuleManager(org.terasology.engine.core.module.ModuleManager) TypeRegistry(org.terasology.reflection.TypeRegistry)

Aggregations

EntitySystemLibrary (org.terasology.engine.entitySystem.metadata.EntitySystemLibrary)6 TypeHandlerLibrary (org.terasology.persistence.typeHandling.TypeHandlerLibrary)6 ModuleManager (org.terasology.engine.core.module.ModuleManager)5 BeforeEach (org.junit.jupiter.api.BeforeEach)3 ContextImpl (org.terasology.engine.context.internal.ContextImpl)3 PojoEntityManager (org.terasology.engine.entitySystem.entity.internal.PojoEntityManager)3 PojoPrefabManager (org.terasology.engine.entitySystem.prefab.internal.PojoPrefabManager)3 ModuleEnvironment (org.terasology.gestalt.module.ModuleEnvironment)3 TypeRegistry (org.terasology.reflection.TypeRegistry)3 Reflections (org.reflections.Reflections)2 NetworkSystem (org.terasology.engine.network.NetworkSystem)2 TypeHandlerLibraryImpl (org.terasology.engine.persistence.typeHandling.TypeHandlerLibraryImpl)2 ModuleTypeRegistry (org.terasology.reflection.ModuleTypeRegistry)2 CopyStrategyLibrary (org.terasology.reflection.copy.CopyStrategyLibrary)2 ArrayList (java.util.ArrayList)1 AutoConfigManager (org.terasology.engine.config.flexible.AutoConfigManager)1 EventSystem (org.terasology.engine.entitySystem.event.internal.EventSystem)1 EventSystemImpl (org.terasology.engine.entitySystem.event.internal.EventSystemImpl)1 ComponentLibrary (org.terasology.engine.entitySystem.metadata.ComponentLibrary)1 Prefab (org.terasology.engine.entitySystem.prefab.Prefab)1