1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00
tobspr_shapez.io/src/js/game/components/constant_signal.js
2020-09-19 21:14:21 +02:00

36 lines
910 B
JavaScript

import { gItemRegistry } from "../../core/global_registries";
import { types } from "../../savegame/serialization";
import { Component } from "../component";
import { BaseItem } from "../base_item";
import { typeItemSingleton } from "../item_resolver";
export class ConstantSignalComponent extends Component {
static getId() {
return "ConstantSignal";
}
static getSchema() {
return {
signal: types.nullable(typeItemSingleton),
};
}
/**
* Copy the current state to another component
* @param {ConstantSignalComponent} otherComponent
*/
copyAdditionalStateTo(otherComponent) {
otherComponent.signal = this.signal;
}
/**
*
* @param {object} param0
* @param {BaseItem=} param0.signal The signal to store
*/
constructor({ signal = null }) {
super();
this.signal = signal;
}
}