json.setUsePrototypes(false); json.setSerializer(Skin.class, new ReadOnlySerializer<Skin>() { public Skin read (Json json, JsonValue typeToValueMap, Class ignored) { for (JsonValue valueMap = typeToValueMap.child; valueMap != null; valueMap = valueMap.next) { json.setSerializer(BitmapFont.class, new ReadOnlySerializer<BitmapFont>() { public BitmapFont read (Json json, JsonValue jsonData, Class type) { String path = json.readValue("file", String.class, jsonData); json.setSerializer(Color.class, new ReadOnlySerializer<Color>() { public Color read (Json json, JsonValue jsonData, Class type) { if (jsonData.isString()) return get(jsonData.asString(), Color.class); json.setSerializer(TintedDrawable.class, new ReadOnlySerializer() { public Object read (Json json, JsonValue jsonData, Class type) { String name = json.readValue("name", String.class, jsonData);
json.setUsePrototypes(false); json.setSerializer(Skin.class, new ReadOnlySerializer<Skin>() { public Skin read (Json json, JsonValue typeToValueMap, Class ignored) { for (JsonValue valueMap = typeToValueMap.child; valueMap != null; valueMap = valueMap.next) { json.setSerializer(BitmapFont.class, new ReadOnlySerializer<BitmapFont>() { public BitmapFont read (Json json, JsonValue jsonData, Class type) { String path = json.readValue("file", String.class, jsonData); json.setSerializer(Color.class, new ReadOnlySerializer<Color>() { public Color read (Json json, JsonValue jsonData, Class type) { if (jsonData.isString()) return get(jsonData.asString(), Color.class); json.setSerializer(TintedDrawable.class, new ReadOnlySerializer() { public Object read (Json json, JsonValue jsonData, Class type) { String name = json.readValue("name", String.class, jsonData);
@Override public WorldSerializationManager.ArtemisSerializer register(Class<?> type, Json.Serializer serializer) { json.setSerializer(type, serializer); return this; }
@Initiate void initialize() { json = new Json(); json.setSerializer(ScaleFactorModel.class, new ScaleFactorJsonSerializer()); json.setSerializer(InputFile.class, inputFileSerializer = new InputFileSerializer()); }
public JsonArtemisSerializer(World world) { super(world); componentCollector = new ComponentCollector(world); referenceTracker = new ReferenceTracker(world); lookup = new ComponentLookupSerializer(); intBagEntitySerializer = new IntBagEntitySerializer(world); entitySerializer = new EntitySerializer(world, referenceTracker); transmuterEntrySerializer = new TransmuterEntrySerializer(); json = new Json(JsonWriter.OutputType.json); json.setIgnoreUnknownFields(true); json.setSerializer(SaveFileFormat.ComponentIdentifiers.class, lookup); json.setSerializer(Bag.class, new EntityBagSerializer(world)); json.setSerializer(IntBag.class, intBagEntitySerializer); json.setSerializer(Entity.class, entitySerializer); json.setSerializer(ArchetypeMapper.class, new ArchetypeMapperSerializer()); json.setSerializer(ArchetypeMapper.TransmuterEntry.class, transmuterEntrySerializer); }
json.setSerializer(Skin.class, new ReadOnlySerializer<Skin>() { @Override public Skin read(Json json, JsonValue typeToValueMap, @SuppressWarnings("rawtypes") Class ignored) { json.setSerializer(BitmapFont.class, new ReadOnlySerializer<BitmapFont>() { @Override public BitmapFont read(Json json, JsonValue jsonData, @SuppressWarnings("rawtypes") Class type) {
@Initiate public void initialize() { json = new Json(); json.setSerializer(VersionData.class, new VersionData.Serializer()); }
json.setUsePrototypes(false); json.setSerializer(Skin.class, new ReadOnlySerializer<Skin>() { public Skin read (Json json, JsonValue typeToValueMap, Class ignored) { for (JsonValue valueMap = typeToValueMap.child; valueMap != null; valueMap = valueMap.next) { json.setSerializer(BitmapFont.class, new ReadOnlySerializer<BitmapFont>() { public BitmapFont read (Json json, JsonValue jsonData, Class type) { String path = json.readValue("file", String.class, jsonData); json.setSerializer(Color.class, new ReadOnlySerializer<Color>() { public Color read (Json json, JsonValue jsonData, Class type) { if (jsonData.isString()) return get(jsonData.asString(), Color.class); json.setSerializer(TintedDrawable.class, new ReadOnlySerializer() { public Object read (Json json, JsonValue jsonData, Class type) { String name = json.readValue("name", String.class, jsonData);
json.setSerializer(Pattern.class, new Serializer<Pattern>() { @Override public void write(Json json, Pattern object, Class knownType) { json.setSerializer(Coord.class, new Serializer<Coord>() { @Override public void write(Json json, Coord object, Class knownType) { json.setSerializer(GreasedRegion.class, new Serializer<GreasedRegion>() { @Override public void write(Json json, GreasedRegion object, Class knownType) { json.setSerializer(IntVLA.class, new Serializer<IntVLA>() { @Override public void write(Json json, IntVLA object, Class knownType) { json.setSerializer(IntDoubleOrderedMap.class, new Serializer<IntDoubleOrderedMap>() { @Override public void write(Json json, IntDoubleOrderedMap object, Class knownType) { json.setSerializer(StringStringMap.class, new Serializer<StringStringMap>() { @Override public void write(Json json, StringStringMap object, Class knownType) { json.setSerializer(OrderedMap.class, new Serializer<OrderedMap>() { @Override public void write(Json json, OrderedMap object, Class knownType) { json.setSerializer(EnumOrderedMap.class, new Serializer<EnumOrderedMap>() {