Refactor conversation stuff
This commit is contained in:
15
item/Item.gd
15
item/Item.gd
@@ -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]
|
||||
Reference in New Issue
Block a user