diff options
| author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-04-12 19:11:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-12 19:11:02 +0200 |
| commit | 5ff579652ef80207a780a80399be376c345342b0 (patch) | |
| tree | 6f80311a35d8fd6bb41d63b8ce2758891146d128 /src/main/java/at/hannibal2/skyhanni/data/jsonobjects | |
| parent | 7960d2ad27ac68ea9dcfaf848bd611b13db0af87 (diff) | |
| download | skyhanni-5ff579652ef80207a780a80399be376c345342b0.tar.gz skyhanni-5ff579652ef80207a780a80399be376c345342b0.tar.bz2 skyhanni-5ff579652ef80207a780a80399be376c345342b0.zip | |
Backend: Remove Neu Constant (#1191)
Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/jsonobjects')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuRNGScore.kt | 9 | ||||
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuReforgeStoneJson.kt | 63 | ||||
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuSacksJson.kt (renamed from src/main/java/at/hannibal2/skyhanni/data/jsonobjects/other/NeuSacksJson.kt) | 3 | ||||
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuSkillLevelJson.kt | 8 |
4 files changed, 81 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuRNGScore.kt b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuRNGScore.kt new file mode 100644 index 000000000..d63a9ae79 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuRNGScore.kt @@ -0,0 +1,9 @@ +package at.hannibal2.skyhanni.data.jsonobjects.repo.neu + +import at.hannibal2.skyhanni.utils.NEUInternalName +import com.google.gson.annotations.Expose + +data class NeuRNGScore( + @Expose val catacombs: Map<String, Map<NEUInternalName, Long>>, + @Expose val slayer: Map<String, Map<NEUInternalName, Long>> +) diff --git a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuReforgeStoneJson.kt b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuReforgeStoneJson.kt new file mode 100644 index 000000000..c450e3910 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuReforgeStoneJson.kt @@ -0,0 +1,63 @@ +package at.hannibal2.skyhanni.data.jsonobjects.repo.neu; + +import at.hannibal2.skyhanni.utils.LorenzRarity +import at.hannibal2.skyhanni.utils.NEUInternalName +import com.google.gson.annotations.Expose +import com.google.gson.annotations.SerializedName + +data class NeuReforgeStoneJson( + @Expose val internalName: NEUInternalName, + @Expose val reforgeName: String, + @Expose @SerializedName("itemTypes") val rawItemTypes: Any, + @Expose val requiredRarities: List<LorenzRarity>, + @Expose val reforgeCosts: Map<LorenzRarity, Long>, + @Expose val reforgeStats: Map<LorenzRarity, Map<String, Double>>, + @Expose @SerializedName("reforgeAbility") val rawReforgeAbility: Any?, +) { + + private lateinit var reforgeAbilityField: Map<LorenzRarity, String> + + val reforgeAbility + get() = if (this::reforgeAbilityField.isInitialized) reforgeAbilityField + else { + reforgeAbilityField = when (this.rawReforgeAbility) { + is String -> { + this.requiredRarities.associateWith { this.rawReforgeAbility } + } + + is Map<*, *> -> (this.rawReforgeAbility as? Map<String, String>)?.mapKeys { + LorenzRarity.valueOf( + it.key.uppercase().replace(" ", "_") + ) + } ?: emptyMap() + + else -> emptyMap() + } + reforgeAbilityField + } + + /* used in ReforgeAPI which isn't in beta yet + val itemType: Pair<String, List<NEUInternalName>> by lazy { + val any = this.rawItemTypes + return@lazy when (any) { + is String -> { + any.replace("/", "_AND_").uppercase() to emptyList() + } + + is Map<*, *> -> { + val type = "SPECIAL_ITEMS" + val map = any as? Map<String, List<String>> ?: return@lazy type to emptyList() + val internalNames = map["internalName"]?.map { it.asInternalName() } ?: emptyList() + val itemType = map["itemid"]?.map { + NEUItems.getInternalNamesForItemId(Item.getByNameOrId(it)) + }?.flatten() + ?: emptyList() + type to (internalNames + itemType) + } + + else -> throw IllegalStateException() + } + } +*/ +} + diff --git a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/other/NeuSacksJson.kt b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuSacksJson.kt index c323211fb..fe0ae5b49 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/other/NeuSacksJson.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuSacksJson.kt @@ -1,9 +1,8 @@ -package at.hannibal2.skyhanni.data.jsonobjects.other +package at.hannibal2.skyhanni.data.jsonobjects.repo.neu import at.hannibal2.skyhanni.utils.NEUInternalName import com.google.gson.annotations.Expose - data class NeuSacksJson( @Expose val sacks: Map<String, SackInfo> ) diff --git a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuSkillLevelJson.kt b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuSkillLevelJson.kt new file mode 100644 index 000000000..d8ac8c838 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/neu/NeuSkillLevelJson.kt @@ -0,0 +1,8 @@ +package at.hannibal2.skyhanni.data.jsonobjects.repo.neu + +import com.google.gson.annotations.Expose +import com.google.gson.annotations.SerializedName + +data class NeuSkillLevelJson( + @Expose @SerializedName("leveling_xp") val levelingXp: List<Int> +) |
