diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-25 16:55:33 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-25 16:55:33 +0100 |
commit | c4997e21053c8671ed4c5474fb70df6ae58dae06 (patch) | |
tree | 9b17d0fa1a46dc7571fbca8a2d09dc9aaec98dd0 /src/main/kotlin/repo/Reforge.kt | |
parent | ddebaf47900dfab41590c97c202984142ae5b9f6 (diff) | |
download | Firmament-c4997e21053c8671ed4c5474fb70df6ae58dae06.tar.gz Firmament-c4997e21053c8671ed4c5474fb70df6ae58dae06.tar.bz2 Firmament-c4997e21053c8671ed4c5474fb70df6ae58dae06.zip |
feat: Add reforge recipes
Diffstat (limited to 'src/main/kotlin/repo/Reforge.kt')
-rw-r--r-- | src/main/kotlin/repo/Reforge.kt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/kotlin/repo/Reforge.kt b/src/main/kotlin/repo/Reforge.kt index b52adc6..dc0d93d 100644 --- a/src/main/kotlin/repo/Reforge.kt +++ b/src/main/kotlin/repo/Reforge.kt @@ -36,6 +36,10 @@ data class Reforge( ) { val eligibleItems get() = allowOn ?: itemTypes ?: listOf() + val statUniverse: Set<String> = Rarity.entries.flatMapTo(mutableSetOf()) { + reforgeStats?.get(it)?.keys ?: emptySet() + } + @Serializable(with = ReforgeEligibilityFilter.Serializer::class) sealed interface ReforgeEligibilityFilter { object ItemTypesSerializer : KSerializer<List<ReforgeEligibilityFilter>> { @@ -108,7 +112,7 @@ data class Reforge( @Serializable(with = RarityMapped.Serializer::class) sealed interface RarityMapped<T> { - fun get(rarity: Rarity): T? + fun get(rarity: Rarity?): T? class Serializer<T>( val values: KSerializer<T> @@ -140,14 +144,14 @@ data class Reforge( @Serializable data class Direct<T>(val value: T) : RarityMapped<T> { - override fun get(rarity: Rarity): T { + override fun get(rarity: Rarity?): T { return value } } @Serializable data class PerRarity<T>(val values: Map<Rarity, T>) : RarityMapped<T> { - override fun get(rarity: Rarity): T? { + override fun get(rarity: Rarity?): T? { return values[rarity] } } |