Skip to content

Commit

Permalink
small change
Browse files Browse the repository at this point in the history
Signed-off-by: Empa <42304516+ItsEmpa@users.noreply.github.com>
  • Loading branch information
ItsEmpa committed Jul 6, 2024
1 parent cc5759b commit 94d70c0
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,29 +478,22 @@ class ProfitMinionCalculator(version: ElementaVersion) : WindowScreen(version) {
1 -> testUpgrades = listOf(upgrade1)
2 -> testUpgrades = listOf(upgrade1, upgrade2)
}
val bestMinionsMap = MinionData.getMostProfitMinion(testUpgrades, fuel)

// Gets the price of the current test
var testMinionPrice = Int.MIN_VALUE.toDouble()
for (`val` in bestMinionsMap.values) {
if (`val` > testMinionPrice) {
testMinionPrice = `val`
MinionData.getBestMinions(testUpgrades, fuel).maxByOrNull { it.second }?.let { (_ , bestPrice) ->
if (bestPrice > bestProfit) {
bestUpgrades = testUpgrades
bestMinionFuel = fuel
}
}

if (testMinionPrice > bestProfit) {
bestUpgrades = testUpgrades
bestMinionFuel = fuel
}

println(testUpgrades)
}
}
}

resetFuels()
if (bestMinionFuel != null) {
changeFuel(bestMinionFuel.id, true)
bestMinionFuel?.let {
changeFuel(it.id, true)
}

resetUpgrades()
Expand Down

0 comments on commit 94d70c0

Please sign in to comment.