Refactor GameData, remove deprecated getGsonFactory

- Fix day-of-week dungeons
- AvatarSkill max level enforcement from excels
- Partial fix to bonus levels (need packet on talent update)
This commit is contained in:
AnimeGitB
2022-10-13 18:31:34 +10:30
parent bb342f9114
commit 4e75361ad4
14 changed files with 137 additions and 145 deletions

View File

@@ -59,11 +59,6 @@ public final class JsonUtils {
.registerTypeAdapter(DynamicFloat.class, new DynamicFloatAdapter())
.create();
@Deprecated(forRemoval = true)
public static Gson getGsonFactory() {
return gson;
}
/*
* Encode an object to a JSON string
*/
@@ -79,7 +74,7 @@ public final class JsonUtils {
return gson.fromJson(fileReader, classType);
}
@Deprecated
@Deprecated(forRemoval = true)
public static <T> T loadToClass(String filename, Class<T> classType) throws IOException {
try (InputStreamReader fileReader = new InputStreamReader(new FileInputStream(Utils.toFilePath(filename)), StandardCharsets.UTF_8)) {
return loadToClass(fileReader, classType);
@@ -96,7 +91,7 @@ public final class JsonUtils {
return gson.fromJson(fileReader, TypeToken.getParameterized(List.class, classType).getType());
}
@Deprecated
@Deprecated(forRemoval = true)
public static <T> List<T> loadToList(String filename, Class<T> classType) throws IOException {
try (InputStreamReader fileReader = new InputStreamReader(new FileInputStream(Utils.toFilePath(filename)), StandardCharsets.UTF_8)) {
return loadToList(fileReader, classType);
@@ -113,7 +108,7 @@ public final class JsonUtils {
return gson.fromJson(fileReader, TypeToken.getParameterized(Map.class, keyType, valueType).getType());
}
@Deprecated
@Deprecated(forRemoval = true)
public static <T1,T2> Map<T1,T2> loadToMap(String filename, Class<T1> keyType, Class<T2> valueType) throws IOException {
try (InputStreamReader fileReader = new InputStreamReader(new FileInputStream(Utils.toFilePath(filename)), StandardCharsets.UTF_8)) {
return loadToMap(fileReader, keyType, valueType);