Add RuneType enum and DamageType.ANTISIEGE
RuneType covers the rune_type values in the client cache data (CLASS, DISCIPLINE, RACE, TALENT). ANTISIEGE matches the combat_attack_resist key in the cache data. RuneTemplate.rune_type and combat_attack_resist on both cache templates now use these enums. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0d48080e38
commit
c14231afb9
6 files changed
+31
-11
No files matched your search
+13
-5
@@ -158,14 +158,22 @@ public class CacheParserUtil {
|
||||
return valueMap;
|
||||
}
|
||||
|
||||
public static LinkedHashMap<String, Float> readFloatMap(JSONObject mapJson) {
|
||||
// {"SLASHING": 0.0, ...} -> enum map
|
||||
|
||||
LinkedHashMap<String, Float> floatMap = new LinkedHashMap<>();
|
||||
public static <E extends Enum<E>> EnumMap<E, Float> readEnumFloatMap(Class<E> enumClass, JSONObject mapJson,
|
||||
int templateId, String fieldName) {
|
||||
|
||||
for (String key : mapJson.keySet())
|
||||
floatMap.put(key, mapJson.getFloat(key));
|
||||
EnumMap<E, Float> enumMap = new EnumMap<>(enumClass);
|
||||
E enumValue;
|
||||
|
||||
return floatMap;
|
||||
for (String key : mapJson.keySet()) {
|
||||
enumValue = readEnum(enumClass, key, templateId, fieldName);
|
||||
|
||||
if (enumValue != null)
|
||||
enumMap.put(enumValue, mapJson.getFloat(key));
|
||||
}
|
||||
|
||||
return enumMap;
|
||||
}
|
||||
|
||||
// Values are read as long and wrapped to int so unsigned 32-bit hashes survive.
|
||||
|
||||
Reference in new issue
Block a user