From 5ff579652ef80207a780a80399be376c345342b0 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Fri, 12 Apr 2024 19:11:02 +0200 Subject: 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> --- .../skyhanni/features/skillprogress/SkillUtil.kt | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/skillprogress') diff --git a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillUtil.kt b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillUtil.kt index 127f9459d..b4af74d13 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillUtil.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillUtil.kt @@ -7,9 +7,6 @@ import at.hannibal2.skyhanni.api.SkillAPI.excludedSkills import at.hannibal2.skyhanni.api.SkillAPI.levelingMap import at.hannibal2.skyhanni.utils.Quad import com.google.common.base.Splitter -import com.google.gson.JsonArray -import io.github.moulberry.notenoughupdates.util.Constants -import io.github.moulberry.notenoughupdates.util.Utils object SkillUtil { @@ -125,16 +122,8 @@ object SkillUtil { return level } - fun calculateLevelXp(levelingArray: JsonArray, level: Int): Double { - var totalXp = 0.0 - for (i in 0 until level + 1) { - val xp = levelingArray[i].asDouble - totalXp += xp - } - return totalXp + fun calculateLevelXp(level: Int): Double { + return SkillAPI.levelArray.asSequence().take(level + 1).sumOf { it.toDouble() } } - fun levelArray(): JsonArray = - Utils.getElement(Constants.LEVELING, "leveling_xp").asJsonArray - } -- cgit