aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/repo/PetData.kt
diff options
context:
space:
mode:
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) }
+}