libGDX Json converts Enums to strings and therefore cannot serialize / de-serialize Map keys to anything but strings.
To fix this, either...
- Use strings for keys in Maps (ObjectMap, HashMap ect.).
Use strings for keys in Maps (ObjectMap, HashMap ect.).
- Use GSON which can serialize Enum Map Keys just fine
Use GSON, which can serialize Enum Map Keys just fine.
- Write lost of special serialization / de-serialization code using a class that implements Json.Serializer where T is your map and then register that with your libGDX Json instance .
Write lots of special serialization / de-serialization code using a class that implements
Json.Serializer<T>whereTis your map and then register that with your libGDX Json instance.
I recommend option one or two.