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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user