Serialize fixes
@@ -12,8 +12,8 @@ import java.io.IOException;
@SuppressWarnings("unchecked")
public class DefaultSerializers{
- public static StringMap typeMappings = new StringMap();
- public static String[] typeReplacements = {"io.anuke."};
+ public static StringMap typeMappings = StringMap.of();
+ public static String[] typeReplacements = {"io.anuke.", "", "arc.collection", "arc.struct"};
public static void register(Settings settings){
settings.setSerializer(IntArray.class, new TypeSerializer<IntArray>(){
@@ -230,8 +230,8 @@ public class DefaultSerializers{
}
private static Class<?> lookup(String name) throws ClassNotFoundException{
- for(String replacement : typeReplacements){
- name = name.replace(replacement, "");
+ for(int i = 0; i < typeReplacements.length; i++){
+ name = name.replace(typeReplacements[i], typeReplacements[i + 1]);
}
return Class.forName(typeMappings.get(name, name));
}
