code cleanup, shortening things

Former-commit-id: d1c81cf3207fff4dd311e9b6c3beb04c194aebc5
Former-commit-id: 26f5042ba41cd577e681a22465435945434c864b
This commit is contained in:
Song Minjae
2016-12-17 14:16:42 +09:00
parent af8516be68
commit 56530a6041
24 changed files with 473 additions and 672 deletions

View File

@@ -5,7 +5,7 @@ import net.torvald.terrarum.gameactors.ActorInventory
import net.torvald.terrarum.gameactors.Player
import net.torvald.terrarum.gameactors.Pocketed
import net.torvald.terrarum.gameitem.EquipPosition
import net.torvald.terrarum.itemproperties.ItemPropCodex
import net.torvald.terrarum.itemproperties.ItemCodex
/**
* Created by SKYHi14 on 2016-12-12.
@@ -55,11 +55,11 @@ internal object Inventory : ConsoleCommand {
}
private fun addItem(refId: Int, amount: Int = 1) {
target.inventory.add(ItemPropCodex[refId], amount)
target.inventory.add(ItemCodex[refId], amount)
}
private fun equipItem(refId: Int) {
val item = ItemPropCodex[refId]
val item = ItemCodex[refId]
// if the item does not exist, add it first
if (!target.inventory.contains(item)) {