Refactor conversation stuff

This commit is contained in:
2026-01-14 23:20:56 -06:00
parent d916e65990
commit 5af98a69a2
18 changed files with 136 additions and 35 deletions

View File

@@ -8,6 +8,11 @@ enum ItemType {
KEY_ITEM,
}
enum ItemId {
NULL,
POTION,
}
# Properties
var itemType:ItemType
var key:String
@@ -22,5 +27,11 @@ func getName() -> String:
return self.key
# Item Table
static var NULL:Item = Item.new("NULL", ItemType.NULL)
static var POTION:Item = Item.new("POTION", ItemType.MEDICINE)
static var ITEM_DEFINITIONS = {
[ItemId.NULL]: Item.new("NULL", ItemType.NULL),
[ItemId.POTION]: Item.new("POTION", ItemType.MEDICINE),
}
static func getItemById(itemId:ItemId) -> Item:
assert(ITEM_DEFINITIONS.has(itemId))
return ITEM_DEFINITIONS[itemId]