1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Update storage to also return if its full or not

This commit is contained in:
tobspr
2020-08-14 13:15:26 +02:00
parent 1dab9539bf
commit 349657bafc
3 changed files with 35 additions and 17 deletions

View File

@@ -2,6 +2,8 @@ import { types } from "../../savegame/serialization";
import { BaseItem, enumItemType } from "../base_item";
import { Component } from "../component";
import { typeItemSingleton } from "../item_resolver";
import { ColorItem } from "../items/color_item";
import { ShapeItem } from "../items/shape_item";
export class StorageComponent extends Component {
static getId() {
@@ -76,6 +78,14 @@ export class StorageComponent extends Component {
return false;
}
/**
* Returns whether the storage is full
* @returns {boolean}
*/
getIsFull() {
return this.storedCount >= this.maximumStorage;
}
/**
* @param {BaseItem} item
*/