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/InventoryItem.js | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 resources/js/classes/InventoryItem.js (limited to 'resources/js/classes/InventoryItem.js') diff --git a/resources/js/classes/InventoryItem.js b/resources/js/classes/InventoryItem.js new file mode 100644 index 0000000..9dfdbcc --- /dev/null +++ b/resources/js/classes/InventoryItem.js @@ -0,0 +1,40 @@ +class InventoryItem { + /** + * @type {Item} + */ + item = null; + + /** + * @type {number} + */ + quantity = 1; + + /** + * @param {Item} item + */ + constructor (item) { + this.item = item; + } + + /* Item */ + + get slug () { + return this.item.slug; + } + + get name () { + return this.item.name; + } + + get category () { + return this.item.category; + } + + get type () { + return this.item.type; + } + + get sprite () { + return this.item.sprite; + } +} -- cgit v1.2.3