mirror of
https://github.com/tobspr-games/shapez.io.git
synced 2026-01-20 11:31:15 -08:00
Store lever state
This commit is contained in:
parent
5ec50678b0
commit
b478f4be63
1 changed files with 27 additions and 20 deletions
|
|
@ -1,20 +1,27 @@
|
|||
import { Component } from "../component";
|
||||
|
||||
export class LeverComponent extends Component {
|
||||
static getId() {
|
||||
return "Lever";
|
||||
}
|
||||
|
||||
duplicateWithoutContents() {
|
||||
return new LeverComponent({ toggled: this.toggled });
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} param0
|
||||
* @param {boolean=} param0.toggled
|
||||
*/
|
||||
constructor({ toggled = false }) {
|
||||
super();
|
||||
this.toggled = toggled;
|
||||
}
|
||||
}
|
||||
import { Component } from "../component";
|
||||
import { types } from "../../savegame/serialization";
|
||||
|
||||
export class LeverComponent extends Component {
|
||||
static getId() {
|
||||
return "Lever";
|
||||
}
|
||||
|
||||
static getSchema() {
|
||||
return {
|
||||
toggled: types.bool,
|
||||
};
|
||||
}
|
||||
|
||||
duplicateWithoutContents() {
|
||||
return new LeverComponent({ toggled: this.toggled });
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} param0
|
||||
* @param {boolean=} param0.toggled
|
||||
*/
|
||||
constructor({ toggled = false }) {
|
||||
super();
|
||||
this.toggled = toggled;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue