aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt')
-rw-r--r--src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt b/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
index 2ee581c..f457ae4 100644
--- a/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
+++ b/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
@@ -59,29 +59,7 @@ class VisitorDetection {
private fun parseGardenLoreLine(rewardLine: String): Pair<ItemId, Double>? {
val f = rewardLine.unformattedString().trim()
- return parseSpecialReward(f)
- ?: idProvider.findStackableItemByName(f, true)
- }
-
- private val specialRewardRegex = "\\+(?<amount>${SHORT_NUMBER_PATTERN})x? (?<what>.*)".toPattern()
-
- private fun parseSpecialReward(specialLine: String): Pair<ItemId, Double>? {
- specialRewardRegex.useMatcher(specialLine) {
- val id = when (group("what")) {
- "Copper" -> ItemId.COPPER
- "Bits" -> ItemId.BITS
- "Garden Experience" -> ItemId.GARDEN
- "Farming XP" -> ItemId.FARMING
- "Gold Essence" -> ItemId.GOLD_ESSENCE
- "Gemstone Powder" -> ItemId.GEMSTONE_POWDER
- "Mithril Powder" -> ItemId.MITHRIL_POWDER
- "Pelts" -> ItemId.PELT
- "Fine Flour" -> ItemId.FINE_FLOUR
- else -> ItemId.NIL
- }
- return Pair(id, parseShortNumber(group("amount")))
- }
- return null
+ return idProvider.findStackableItemByName(f, true)
}