aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/repo/PetData.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-10-28 12:07:55 +0100
committerLinnea Gräf <nea@nea.moe>2024-10-28 12:07:55 +0100
commitc38dcee2c5f483ef5990ae9204355e1bc3c2bf74 (patch)
tree3b70359076001e14514c496e3c44980fdbd92d01 /src/main/kotlin/repo/PetData.kt
parent8ab44088546bf3360564e1a09f0831fea7659d2e (diff)
downloadfirmament-c38dcee2c5f483ef5990ae9204355e1bc3c2bf74.tar.gz
firmament-c38dcee2c5f483ef5990ae9204355e1bc3c2bf74.tar.bz2
firmament-c38dcee2c5f483ef5990ae9204355e1bc3c2bf74.zip
Make REI optional
Diffstat (limited to 'src/main/kotlin/repo/PetData.kt')
-rw-r--r--src/main/kotlin/repo/PetData.kt24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/kotlin/repo/PetData.kt b/src/main/kotlin/repo/PetData.kt
new file mode 100644
index 0000000..2ce3402
--- /dev/null
+++ b/src/main/kotlin/repo/PetData.kt
@@ -0,0 +1,24 @@
+package moe.nea.firmament.repo
+
+import io.github.moulberry.repo.data.Rarity
+import moe.nea.firmament.util.HypixelPetInfo
+
+// TODO: add in extra data like pet info, into this structure
+data class PetData(
+ val rarity: Rarity,
+ val petId: String,
+ val exp: Double,
+ val isStub: Boolean = false,
+) {
+ companion object {
+ fun fromHypixel(petInfo: HypixelPetInfo) = PetData(
+ petInfo.tier, petInfo.type, petInfo.exp,
+ )
+
+ fun forLevel(petId: String, rarity: Rarity, level: Int) = PetData(
+ rarity, petId, ExpLadders.getExpLadder(petId, rarity).getPetExpForLevel(level).toDouble()
+ )
+ }
+
+ val levelData by lazy { ExpLadders.getExpLadder(petId, rarity).getPetLevel(exp) }
+}