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

21 lines
470 B
Kotlin

package com.last.commit.inventory
class Inventory {
val items: MutableList<InventoryItem> = ArrayList()
public var updated = false
/**
* @param name the name of the subtexture loaded from xml
*/
fun add(name: String) {
if (this.items.size < 8) {
items.add(InventoryItem(name))
this.updated = true
}
}
fun remove(name: String) {
items.removeIf() {item -> item.name == name}
}
}