1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00
tobspr_shapez.io/src/js/game/components/constant_signal.js

31 lines
754 B
JavaScript
Raw Normal View History

2020-08-12 19:05:32 +00:00
import { gItemRegistry } from "../../core/global_registries";
import { types } from "../../savegame/serialization";
import { Component } from "../component";
import { BaseItem } from "../base_item";
export class ConstantSignalComponent extends Component {
static getId() {
return "ConstantSignal";
}
static getSchema() {
return {
signal: types.nullable(types.obj(gItemRegistry)),
};
}
duplicateWithoutContents() {
return new ConstantSignalComponent({ signal: this.signal });
}
/**
*
* @param {object} param0
* @param {BaseItem=} param0.signal The signal to store
*/
constructor({ signal = null }) {
super();
this.signal = signal;
}
}