RecordAndReplayCurrentStatus recordAndReplayCurrentStatus = new RecordAndReplayCurrentStatus(); rootContext.put(RecordAndReplayCurrentStatus.class, recordAndReplayCurrentStatus); RecordAndReplayUtils recordAndReplayUtils = new RecordAndReplayUtils();
private void setUpLocalPlayer(Context context) { LocalPlayer localPlayer = new LocalPlayer(); localPlayer.setRecordAndReplayClasses(new DirectionAndOriginPosRecorderList(), new RecordAndReplayCurrentStatus()); clientEntity = mock(EntityRef.class); ClientComponent clientComponent = new ClientComponent(); characterEntity = mock(EntityRef.class); clientComponent.character = characterEntity; when(clientEntity.getComponent(ClientComponent.class)).thenReturn(clientComponent); localPlayer.setClientEntity(clientEntity); context.put(LocalPlayer.class, localPlayer); registerEntityKeyCapturing(); }
@Before public void setup() { ContextImpl context = new ContextImpl(); context.put(ModuleManager.class, moduleManager); context.put(NetworkSystem.class, mock(NetworkSystem.class)); context.put(RecordAndReplayCurrentStatus.class, new RecordAndReplayCurrentStatus()); CoreRegistry.setContext(context); EntitySystemSetupUtil.addReflectionBasedLibraries(context); EntitySystemSetupUtil.addEntityManagementRelatedClasses(context); entityManager = context.get(EngineEntityManager.class); }
@Before public void setup() { ContextImpl context = new ContextImpl(); CoreRegistry.setContext(context); ReflectFactory reflectFactory = new ReflectionReflectFactory(); CopyStrategyLibrary copyStrategies = new CopyStrategyLibrary(reflectFactory); TypeSerializationLibrary serializationLibrary = new TypeSerializationLibrary(reflectFactory, copyStrategies); EntitySystemLibrary entitySystemLibrary = new EntitySystemLibrary(context, serializationLibrary); compLibrary = entitySystemLibrary.getComponentLibrary(); entityManager = new PojoEntityManager(); entityManager.setComponentLibrary(entitySystemLibrary.getComponentLibrary()); entityManager.setPrefabManager(new PojoPrefabManager(context)); NetworkSystem networkSystem = mock(NetworkSystem.class); when(networkSystem.getMode()).thenReturn(NetworkMode.NONE); EventCatcher eventCatcher = new EventCatcher(null, null); RecordAndReplayCurrentStatus recordAndReplayCurrentStatus = new RecordAndReplayCurrentStatus(); eventSystem = new EventSystemImpl(entitySystemLibrary.getEventLibrary(), networkSystem, eventCatcher, recordAndReplayCurrentStatus); entityManager.setEventSystem(eventSystem); entity = entityManager.create(); }
protected void reset(Set<Name> moduleNames) throws Exception { this.context = new ContextImpl(); RecordAndReplayCurrentStatus recordAndReplayCurrentStatus = new RecordAndReplayCurrentStatus(); context.put(RecordAndReplayCurrentStatus.class, recordAndReplayCurrentStatus); CoreRegistry.setContext(context); setupPathManager(); setupConfig(); setupModuleManager(moduleNames); setupDisplay(); setupAudio(); AssetManager assetManager = setupAssetManager(); setupBlockManager(assetManager); setupExtraDataManager(context); setupCollisionManager(); setupNetwork(); setupEntitySystem(); setupStorageManager(); setupComponentManager(); setupWorldProvider(); setupCelestialSystem(); loadPrefabs(); }
@BeforeClass public static void setupClass() throws Exception { context = new ContextImpl(); CoreRegistry.setContext(context); context.put(RecordAndReplayCurrentStatus.class, new RecordAndReplayCurrentStatus()); moduleManager = ModuleManagerFactory.create(); context.put(ModuleManager.class, moduleManager); ModuleAwareAssetTypeManager assetTypeManager = new ModuleAwareAssetTypeManager(); assetTypeManager.registerCoreAssetType(Prefab.class, (AssetFactory<Prefab, PrefabData>) PojoPrefab::new, "prefabs"); assetTypeManager.switchEnvironment(moduleManager.getEnvironment()); context.put(AssetManager.class, assetTypeManager.getAssetManager()); }
@Before public void setup() throws Exception { ContextImpl context = new ContextImpl(); context.put(RecordAndReplayCurrentStatus.class, new RecordAndReplayCurrentStatus()); CoreRegistry.setContext(context); ModuleManager moduleManager = ModuleManagerFactory.create(); context.put(ModuleManager.class, moduleManager); EntitySystemSetupUtil.addReflectionBasedLibraries(context); ModuleAwareAssetTypeManager assetTypeManager = new ModuleAwareAssetTypeManager(); assetTypeManager.registerCoreAssetType(Prefab.class, (AssetFactory<Prefab, PrefabData>) PojoPrefab::new, "prefabs"); ComponentLibrary componentLibrary = context.get(ComponentLibrary.class); TypeSerializationLibrary typeSerializationLibrary = context.get(TypeSerializationLibrary.class); PrefabFormat prefabFormat = new PrefabFormat(componentLibrary, typeSerializationLibrary); assetTypeManager.registerCoreFormat(Prefab.class, prefabFormat); assetTypeManager.switchEnvironment(moduleManager.getEnvironment()); context.put(AssetManager.class, assetTypeManager.getAssetManager()); NetworkSystem networkSystem = mock(NetworkSystem.class); when(networkSystem.getMode()).thenReturn(NetworkMode.NONE); context.put(NetworkSystem.class, networkSystem); EntitySystemSetupUtil.addEntityManagementRelatedClasses(context); prefabManager = new PojoPrefabManager(context); }
@BeforeClass public static void setupClass() throws Exception { context = new ContextImpl(); ModuleManager moduleManager = ModuleManagerFactory.create(); context.put(ModuleManager.class, moduleManager); ModuleAwareAssetTypeManager assetTypeManager = new ModuleAwareAssetTypeManager(); assetTypeManager.registerCoreAssetType(Prefab.class, (AssetFactory<Prefab, PrefabData>) PojoPrefab::new, "prefabs"); assetTypeManager.switchEnvironment(moduleManager.getEnvironment()); context.put(AssetManager.class, assetTypeManager.getAssetManager()); context.put(RecordAndReplayCurrentStatus.class, new RecordAndReplayCurrentStatus()); CoreRegistry.setContext(context); }
@BeforeClass public static void setupClass() throws Exception { context = new ContextImpl(); ModuleManager moduleManager = ModuleManagerFactory.create(); context.put(ModuleManager.class, moduleManager); ModuleAwareAssetTypeManager assetTypeManager = new ModuleAwareAssetTypeManager(); assetTypeManager.registerCoreAssetType(Prefab.class, (AssetFactory<Prefab, PrefabData>) PojoPrefab::new, "prefabs"); assetTypeManager.switchEnvironment(moduleManager.getEnvironment()); context.put(AssetManager.class, assetTypeManager.getAssetManager()); context.put(RecordAndReplayCurrentStatus.class, new RecordAndReplayCurrentStatus()); CoreRegistry.setContext(context); }
@BeforeClass public static void setupClass() throws Exception { context = new ContextImpl(); ModuleManager moduleManager = ModuleManagerFactory.create(); context.put(ModuleManager.class, moduleManager); ModuleAwareAssetTypeManager assetTypeManager = new ModuleAwareAssetTypeManager(); assetTypeManager.registerCoreAssetType(Prefab.class, (AssetFactory<Prefab, PrefabData>) PojoPrefab::new, "prefabs"); assetTypeManager.switchEnvironment(moduleManager.getEnvironment()); context.put(AssetManager.class, assetTypeManager.getAssetManager()); context.put(RecordAndReplayCurrentStatus.class, new RecordAndReplayCurrentStatus()); CoreRegistry.setContext(context); }
NetworkSystem networkSystem = mock(NetworkSystem.class); when(networkSystem.getMode()).thenReturn(NetworkMode.NONE); recordAndReplayCurrentStatus = new RecordAndReplayCurrentStatus(); RecordedEventStore eventStore = new RecordedEventStore(); RecordAndReplayUtils recordAndReplayUtils = new RecordAndReplayUtils();
@Before public void setup() { context = new ContextImpl(); context.put(RecordAndReplayCurrentStatus.class, new RecordAndReplayCurrentStatus()); context.put(ModuleManager.class, moduleManager); CoreRegistry.setContext(context); TypeSerializationLibrary serializationLibrary = new TypeSerializationLibrary(reflectFactory, copyStrategyLibrary); serializationLibrary.add(Vector3f.class, new Vector3fTypeHandler()); serializationLibrary.add(Quat4f.class, new Quat4fTypeHandler()); NetworkSystem networkSystem = mock(NetworkSystem.class); context.put(NetworkSystem.class, networkSystem); EntitySystemSetupUtil.addReflectionBasedLibraries(context); EntitySystemSetupUtil.addEntityManagementRelatedClasses(context); EngineEntityManager entityManager = context.get(EngineEntityManager.class); entityManager.getComponentLibrary().register(new SimpleUri("test", "gettersetter"), GetterSetterComponent.class); entityManager.getComponentLibrary().register(new SimpleUri("test", "string"), StringComponent.class); entityManager.getComponentLibrary().register(new SimpleUri("test", "integer"), IntegerComponent.class); ComponentLibrary componentLibrary = entityManager.getComponentLibrary(); componentSerializer = new ComponentSerializer(componentLibrary, serializationLibrary); }