mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Remove enumLayer and enumItemType
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { enumDirection, enumInvertedDirections, Vector } from "../../core/vector";
|
||||
import { types } from "../../savegame/serialization";
|
||||
import { BaseItem, enumItemType } from "../base_item";
|
||||
import { BaseItem } from "../base_item";
|
||||
import { Component } from "../component";
|
||||
|
||||
/** @typedef {{
|
||||
* pos: Vector,
|
||||
* directions: enumDirection[],
|
||||
* filter?: enumItemType
|
||||
* filter?: ItemType
|
||||
* }} ItemAcceptorSlot */
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ import { Component } from "../component";
|
||||
/** @typedef {{
|
||||
* pos: Vector,
|
||||
* directions: enumDirection[],
|
||||
* filter?: enumItemType
|
||||
* filter?: ItemType
|
||||
* }} ItemAcceptorSlotConfig */
|
||||
|
||||
export class ItemAcceptorComponent extends Component {
|
||||
@@ -74,7 +74,7 @@ export class ItemAcceptorComponent extends Component {
|
||||
pos: slot.pos,
|
||||
directions: slot.directions,
|
||||
|
||||
// Which type of item to accept (shape | color | all) @see enumItemType
|
||||
// Which type of item to accept (shape | color | all) @see ItemType
|
||||
filter: slot.filter,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { types } from "../../savegame/serialization";
|
||||
import { BaseItem, enumItemType } from "../base_item";
|
||||
import { BaseItem } from "../base_item";
|
||||
import { Component } from "../component";
|
||||
import { typeItemSingleton } from "../item_resolver";
|
||||
import { ColorItem } from "../items/color_item";
|
||||
@@ -65,11 +65,11 @@ export class StorageComponent extends Component {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (itemType === enumItemType.color) {
|
||||
if (itemType === "color") {
|
||||
return /** @type {ColorItem} */ (this.storedItem).color === /** @type {ColorItem} */ (item).color;
|
||||
}
|
||||
|
||||
if (itemType === enumItemType.shape) {
|
||||
if (itemType === "shape") {
|
||||
return (
|
||||
/** @type {ShapeItem} */ (this.storedItem).definition.getHash() ===
|
||||
/** @type {ShapeItem} */ (item).definition.getHash()
|
||||
|
||||
Reference in New Issue
Block a user