You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gamejam-22/core/src/main/kotlin/com/last/commit/inventory/Inventory.kt

18 lines
415 B
Kotlin

package com.last.commit.inventory
class Inventory(path: String) {
val items: MutableList<InventoryItem> = ArrayList()
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)))
}
}