rework inventory handling
parent
11c13170bc
commit
edfeb7b645
@ -1,14 +1,17 @@
|
||||
package com.last.commit.inventory
|
||||
|
||||
class Inventory {
|
||||
class Inventory(path: String) {
|
||||
|
||||
val items: MutableList<InventoryItem> = ArrayList()
|
||||
val textureLoader = InventoryItemTextureLoader("sprites/genericItems_spritesheet_colored")
|
||||
val textureLoader = InventoryItemTextureLoader(path)
|
||||
|
||||
init {
|
||||
textureLoader.parse()
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name the name of the subtexture loaded from xml
|
||||
*/
|
||||
fun add(name: String) {
|
||||
items.add(InventoryItem(name, textureLoader.loadTexture(name)))
|
||||
}
|
||||
|
Loading…
Reference in New Issue