Home Reference Source
import {Component} from 'shapez.io/js/game/component.js'
public class | source

Component

Extends:

BasicSerializableObject → Component

Static Method Summary

Static Public Methods
public static

Returns the components unique id

public static

getSchema(): {}

Should return the schema used for serialization

Constructor Summary

Public Constructor
public

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

Method Summary

Public Methods
public

copyAdditionalStateTo(otherComponent: Component)

Copy the current state to another component

public

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

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

Static Public Methods

public static getId(): string source

Returns the components unique id

Override:

BasicSerializableObject#getId

Return:

string

public static getSchema(): {} source

Should return the schema used for serialization

Override:

BasicSerializableObject#getSchema

Return:

{}

Public Constructors

public constructor() source

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

Override:

BasicSerializableObject#constructor

Public Methods

public copyAdditionalStateTo(otherComponent: Component) source

Copy the current state to another component

Params:

NameTypeAttributeDescription
otherComponent Component

public getDebugString(): string source

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

Return:

string