From eda44cb8743c709c15a7ed03381d05e43728e647 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Thu, 19 Dec 2024 20:18:39 +0100 Subject: feat: Add corpse loot detection --- src/main/kotlin/moe/nea/ledger/ItemChange.kt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/kotlin/moe/nea/ledger/ItemChange.kt') 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): ItemChange { + return ItemChange(pair.first, pair.second, direction) + } + + fun unpairGain(pair: Pair) = unpair(ChangeDirection.GAINED, pair) + fun gain(itemId: ItemId, amount: Number): ItemChange { return ItemChange(itemId, amount.toDouble(), ChangeDirection.GAINED) } -- cgit