From ac151c8ebc4c5546795cdbf5b0c179183e2c71d1 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Mon, 15 Jan 2024 00:32:43 +0100 Subject: Add Pristine Profit Tracker --- .../moe/nea/firmament/util/BazaarPriceStrategy.kt | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/main/kotlin/moe/nea/firmament/util/BazaarPriceStrategy.kt (limited to 'src/main/kotlin/moe/nea/firmament/util/BazaarPriceStrategy.kt') diff --git a/src/main/kotlin/moe/nea/firmament/util/BazaarPriceStrategy.kt b/src/main/kotlin/moe/nea/firmament/util/BazaarPriceStrategy.kt new file mode 100644 index 0000000..8b746cc --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/util/BazaarPriceStrategy.kt @@ -0,0 +1,24 @@ +/* + * SPDX-FileCopyrightText: 2024 Linnea Gräf + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package moe.nea.firmament.util + +import moe.nea.firmament.repo.HypixelStaticData + +enum class BazaarPriceStrategy { + BUY_ORDER, + SELL_ORDER, + NPC_SELL; + + fun getSellPrice(skyblockId: SkyblockId): Double { + val bazaarEntry = HypixelStaticData.bazaarData[skyblockId] ?: return 0.0 + return when (this) { + BUY_ORDER -> bazaarEntry.quickStatus.sellPrice + SELL_ORDER -> bazaarEntry.quickStatus.buyPrice + NPC_SELL -> TODO() + } + } +} -- cgit