You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tobspr_shapez.io/src/js/game/components/lever.js

32 lines
714 B

import { Component } from "../component";
import { types } from "../../savegame/serialization";
export class LeverComponent extends Component {
static getId() {
return "Lever";
}
static getSchema() {
return {
toggled: types.bool,
};
}
/**
* Copy the current state to another component
* @param {LeverComponent} otherComponent
*/
copyAdditionalStateTo(otherComponent) {
otherComponent.toggled = this.toggled;
}
/**
* @param {object} param0
* @param {boolean=} param0.toggled
*/
constructor({ toggled = false }) {
super();
this.toggled = toggled;
}
}