use of org.terasology.engine.persistence.typeHandling.mathTypes.Vector3fTypeHandler in project Terasology by MovingBlocks.
the class TypeHandlerLibraryImpl method populateWithDefaultHandlers.
private static void populateWithDefaultHandlers(TypeHandlerLibrary serializationLibrary) {
// Current Supported
serializationLibrary.addTypeHandlerFactory(new AssetTypeHandlerFactory());
serializationLibrary.addTypeHandler(Name.class, new NameTypeHandler());
serializationLibrary.addTypeHandler(TextureRegion.class, new TextureRegionTypeHandler());
serializationLibrary.addTypeHandler(UITextureRegion.class, new UITextureRegionTypeHandler());
serializationLibrary.addTypeHandler(ChunkMesh.class, new ChunkMeshTypeHandler());
serializationLibrary.addTypeHandlerFactory(new TextureRegionAssetTypeHandlerFactory());
serializationLibrary.addTypeHandler(Color.class, new ColorTypeHandler());
serializationLibrary.addTypeHandler(Colorc.class, new ColorcTypeHandler());
serializationLibrary.addTypeHandler(Vector4f.class, new Vector4fTypeHandler());
serializationLibrary.addTypeHandler(Vector4fc.class, new Vector4fcTypeHandler());
serializationLibrary.addTypeHandler(Vector3f.class, new Vector3fTypeHandler());
serializationLibrary.addTypeHandler(Vector3fc.class, new Vector3fcTypeHandler());
serializationLibrary.addTypeHandler(Vector2f.class, new Vector2fTypeHandler());
serializationLibrary.addTypeHandler(Vector2fc.class, new Vector2fcTypeHandler());
serializationLibrary.addTypeHandler(Vector3i.class, new Vector3iTypeHandler());
serializationLibrary.addTypeHandler(Vector3ic.class, new Vector3icTypeHandler());
serializationLibrary.addTypeHandler(Vector2i.class, new Vector2iTypeHandler());
serializationLibrary.addTypeHandler(Vector2ic.class, new Vector2icTypeHandler());
serializationLibrary.addTypeHandler(Vector4i.class, new Vector4iTypeHandler());
serializationLibrary.addTypeHandler(Vector4ic.class, new Vector4icTypeHandler());
serializationLibrary.addTypeHandler(Rectanglei.class, new RectangleiTypeHandler());
serializationLibrary.addTypeHandler(Rectanglef.class, new RectanglefTypeHandler());
serializationLibrary.addTypeHandler(AABBi.class, new AABBiTypeHandler());
serializationLibrary.addTypeHandler(AABBf.class, new AABBfTypeHandler());
serializationLibrary.addTypeHandler(BlockRegion.class, new BlockRegionTypeHandler());
serializationLibrary.addTypeHandler(BlockArea.class, new BlockAreaTypeHandler());
serializationLibrary.addTypeHandler(BlockAreac.class, new BlockAreacTypeHandler());
serializationLibrary.addTypeHandler(Quaternionf.class, new QuaternionfTypeHandler());
serializationLibrary.addTypeHandler(Quaternionfc.class, new QuaternionfcTypeHandler());
serializationLibrary.addTypeHandler(IntegerRange.class, new IntegerRangeHandler());
}
use of org.terasology.engine.persistence.typeHandling.mathTypes.Vector3fTypeHandler in project Terasology by MovingBlocks.
the class ComponentSerializerTest method setup.
@BeforeEach
public void setup() {
context = new ContextImpl();
context.put(RecordAndReplayCurrentStatus.class, new RecordAndReplayCurrentStatus());
context.put(ModuleManager.class, moduleManager);
CoreRegistry.setContext(context);
Reflections reflections = new Reflections(getClass().getClassLoader());
TypeHandlerLibrary serializationLibrary = new TypeHandlerLibraryImpl(reflections);
serializationLibrary.addTypeHandler(Vector3f.class, new Vector3fTypeHandler());
serializationLibrary.addTypeHandler(Quaternionf.class, new QuaternionfTypeHandler());
NetworkSystem networkSystem = mock(NetworkSystem.class);
when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
context.put(NetworkSystem.class, networkSystem);
EntitySystemSetupUtil.addReflectionBasedLibraries(context);
EntitySystemSetupUtil.addEntityManagementRelatedClasses(context);
EngineEntityManager entityManager = context.get(EngineEntityManager.class);
entityManager.getComponentLibrary().register(new ResourceUrn("test", "gettersetter"), GetterSetterComponent.class);
entityManager.getComponentLibrary().register(new ResourceUrn("test", "string"), StringComponent.class);
entityManager.getComponentLibrary().register(new ResourceUrn("test", "integer"), IntegerComponent.class);
ComponentLibrary componentLibrary = entityManager.getComponentLibrary();
componentSerializer = new ComponentSerializer(componentLibrary, serializationLibrary);
}
Aggregations