get operator on Tile/ItemPropCodex

Former-commit-id: f6c4ecbad8c0ce2486524be70e68292d6aae799e
Former-commit-id: 9738a693eb55861d1292e59d8df2bec7f5603c40
This commit is contained in:
Song Minjae
2016-12-16 23:07:14 +09:00
parent 4552d7b7db
commit a5ca82f2c7
12 changed files with 65 additions and 63 deletions

View File

@@ -12,17 +12,17 @@ import org.newdawn.slick.Graphics
class DroppedItem(private val item: InventoryItem) : ActorWithBody() {
init {
if (item.itemID >= ItemPropCodex.ITEM_COUNT_MAX)
if (item.id >= ItemPropCodex.ITEM_COUNT_MAX)
throw RuntimeException("Attempted to create DroppedItem actor of a real actor; the real actor must be dropped instead.")
isVisible = true
mass = if (item.itemID < TilePropCodex.TILE_UNIQUE_MAX)
TilePropCodex.getProp(item.itemID).density / 1000.0
mass = if (item.id < TilePropCodex.TILE_UNIQUE_MAX)
TilePropCodex[item.id].density / 1000.0
else
ItemPropCodex.getProp(item.itemID).mass
ItemPropCodex[item.id].mass
scale = ItemPropCodex.getProp(item.itemID).scale
scale = ItemPropCodex[item.id].scale
}
override fun update(gc: GameContainer, delta: Int) {