From d3e65b98ca932aef1e05e33d74eaf62be520cdd4 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 18 Aug 2023 16:07:39 +0200 Subject: inventory and items --- resources/js/classes/Item.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'resources/js/classes/Item.js') diff --git a/resources/js/classes/Item.js b/resources/js/classes/Item.js index e274a20..6207cc2 100644 --- a/resources/js/classes/Item.js +++ b/resources/js/classes/Item.js @@ -1 +1,21 @@ -class Item {} +class Item { + constructor (slug) { + this.slug = slug; + } + + get name () { + return slugToName(this.slug); + } + + get category () { + return DB.items[this.slug].category; + } + + get type () { + return DB.items[this.slug].type; + } + + get sprite () { + return DB.items[this.slug].sprite; + } +} -- cgit v1.2.3