diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-19 20:18:39 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-19 20:18:39 +0100 |
commit | eda44cb8743c709c15a7ed03381d05e43728e647 (patch) | |
tree | 557a3bd4f096584158b46921f4826208396b4baa /src/main/kotlin/moe/nea/ledger/ItemChange.kt | |
parent | a046b198645811fe1b7db129942505c379aabb03 (diff) | |
download | LocalTransactionLedger-eda44cb8743c709c15a7ed03381d05e43728e647.tar.gz LocalTransactionLedger-eda44cb8743c709c15a7ed03381d05e43728e647.tar.bz2 LocalTransactionLedger-eda44cb8743c709c15a7ed03381d05e43728e647.zip |
feat: Add corpse loot detection
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/ItemChange.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/ledger/ItemChange.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/ItemChange.kt b/src/main/kotlin/moe/nea/ledger/ItemChange.kt index 834cd2b..186a4e3 100644 --- a/src/main/kotlin/moe/nea/ledger/ItemChange.kt +++ b/src/main/kotlin/moe/nea/ledger/ItemChange.kt @@ -54,6 +54,12 @@ data class ItemChange( return gain(ItemId.COINS, number) } + fun unpair(direction: ChangeDirection, pair: Pair<ItemId, Double>): ItemChange { + return ItemChange(pair.first, pair.second, direction) + } + + fun unpairGain(pair: Pair<ItemId, Double>) = unpair(ChangeDirection.GAINED, pair) + fun gain(itemId: ItemId, amount: Number): ItemChange { return ItemChange(itemId, amount.toDouble(), ChangeDirection.GAINED) } |