Home Reference Source
import {LeverComponent} from 'shapez.io/js/game/components/lever.js'
public class | source

LeverComponent

Extends:

BasicSerializableObjectComponent → LeverComponent

Static Method Summary

Static Public Methods
public static
public static

getSchema(): {"toggled": *}

Constructor Summary

Public Constructor
public

constructor(param0: object)

Member Summary

Public Members
public

toggled: *

Method Summary

Public Methods
public

Copy the current state to another component

Inherited Summary

From class BasicSerializableObject
public static
public static

getId()

public static

Should return the serialization schema

public static

verify(data: *): string | void

public

deserialize(data: any, root: import("./savegame_serializer").GameRoot): string | void

public
From class Component
public static

Returns the components unique id

public static

getSchema(): {}

Should return the schema used for serialization

public

copyAdditionalStateTo(otherComponent: Component)

Copy the current state to another component

public

Returns a string representing the components data, only in dev builds

Static Public Methods

public static getId(): string source

Returns the components unique id

Override:

Component#getId

Return:

string

public static getSchema(): {"toggled": *} source

Should return the schema used for serialization

Override:

Component#getSchema

Return:

{"toggled": *}

Public Constructors

public constructor(param0: object) source

Fixes typeof DerivedComponent is not assignable to typeof Component, compiled out in non-dev builds

Override:

Component#constructor

Params:

NameTypeAttributeDescription
param0 object
param0.toggled boolean=

Public Members

public toggled: * source

Public Methods

public copyAdditionalStateTo(otherComponent: LeverComponent) source

Copy the current state to another component

Override:

Component#copyAdditionalStateTo

Params:

NameTypeAttributeDescription
otherComponent LeverComponent