1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
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; } }