Skip to content

Commit

Permalink
Add ObjectFloatMap to parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
MEEPofFaith committed Jun 13, 2024
1 parent 98900b2 commit cd32d50
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion arc-core/src/arc/util/serialization/Json.java
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,6 @@ public void writeValue(Object value, Class knownType, Class elementType){
writeObjectEnd();
return;
}

if(value instanceof ObjectIntMap){
if(knownType == null) knownType = ObjectIntMap.class;
writeObjectStart(actualType, knownType);
Expand All @@ -614,6 +613,16 @@ public void writeValue(Object value, Class knownType, Class elementType){
writeObjectEnd();
return;
}
if(value instanceof ObjectFloatMap){
if(knownType == null) knownType = ObjectFloatMap.class;
writeObjectStart(actualType, knownType);
for(ObjectFloatMap.Entry entry : ((ObjectFloatMap<?>)value).entries()){
writer.name(convertToString(entry.key));
writer.value(entry.value);
}
writeObjectEnd();
return;
}
if(value instanceof IntMap){
if(knownType == null) knownType = IntMap.class;
writeObjectStart(actualType, knownType);
Expand Down

0 comments on commit cd32d50

Please sign in to comment.