Inventory base
This commit is contained in:
parent
7def0e3835
commit
e97e0017da
2 changed files with 33 additions and 0 deletions
23
server/Inventories/Inventory.js
Normal file
23
server/Inventories/Inventory.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
const ItemStack = require("../ItemStack.js");
|
||||||
|
|
||||||
|
module.exports = class {
|
||||||
|
constructor() {
|
||||||
|
this.Slots = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
saveData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
loadData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getSlot(slot = 0) {
|
||||||
|
return this.Slots[slot]; // If the slot doesn't exist well sucks to be you I guess! Haha :Þ
|
||||||
|
}
|
||||||
|
|
||||||
|
setSlot(slot = 0, itemStack = new ItemStack) {
|
||||||
|
this.Slots[slot] = itemStack;
|
||||||
|
}
|
||||||
|
}
|
10
server/ItemStack.js
Normal file
10
server/ItemStack.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
module.exports = class {
|
||||||
|
constructor(id, count) {
|
||||||
|
this.id = id;
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateCount(count) {
|
||||||
|
this.count += count;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue