aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt')
-rw-r--r--src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt b/src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt
index 22b5392..2872f99 100644
--- a/src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt
+++ b/src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt
@@ -1,11 +1,14 @@
package moe.nea.ledger.modules
+import moe.nea.ledger.ItemChange
+import moe.nea.ledger.ItemId
import moe.nea.ledger.events.ChatReceived
import moe.nea.ledger.events.LateWorldLoadEvent
import moe.nea.ledger.LedgerEntry
import moe.nea.ledger.LedgerLogger
import moe.nea.ledger.SHORT_NUMBER_PATTERN
import moe.nea.ledger.ScoreboardUtil
+import moe.nea.ledger.TransactionType
import moe.nea.ledger.parseShortNumber
import moe.nea.ledger.unformattedString
import moe.nea.ledger.useMatcher
@@ -27,11 +30,11 @@ class BitsDetection @Inject constructor(val ledger: LedgerLogger) {
if (lastBits != bits) {
ledger.logEntry(
LedgerEntry(
- "BITS_PURSE_STATUS",
- Instant.now(),
- 0.0,
- null,
- bits
+ TransactionType.BITS_PURSE_STATUS,
+ Instant.now(),
+ listOf(
+ ItemChange(ItemId.BITS, bits.toDouble(), ItemChange.ChangeDirection.SYNC)
+ )
)
)
lastBits = bits
@@ -46,11 +49,11 @@ class BitsDetection @Inject constructor(val ledger: LedgerLogger) {
if (event.message.startsWith("You consumed a Booster Cookie!")) {
ledger.logEntry(
LedgerEntry(
- "BOOSTER_COOKIE_ATE",
+ TransactionType.BOOSTER_COOKIE_ATE,
Instant.now(),
- 0.0,
- null,
- null,
+ listOf(
+ ItemChange.lose(ItemId.BOOSTER_COOKIE, 1)
+ )
)
)
}