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

BeltComponent

Extends:

BasicSerializableObjectComponent → BeltComponent

Static Method Summary

Static Public Methods
public static

Constructor Summary

Public Constructor
public

constructor(param0: object)

Member Summary

Public Members
public

The path this belt is contained in, not serialized

public

Method Summary

Public Methods
public

Returns the effective length of this belt in tile space

public

getFakeAcceptorSlot(): import("./item_acceptor").ItemAcceptorSlot

Returns fake acceptor slot used for matching

public

getFakeEjectorSlot(): import("./item_ejector").ItemEjectorSlot

Returns fake acceptor slot used for matching

public

Converts from belt space (0 = start of belt ...

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 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.direction enumDirection=

The direction of the belt

Public Members

public assignedPath: BeltPath source

The path this belt is contained in, not serialized

public direction: * source

Public Methods

public getEffectiveLengthTiles(): number source

Returns the effective length of this belt in tile space

Return:

number

public getFakeAcceptorSlot(): import("./item_acceptor").ItemAcceptorSlot source

Returns fake acceptor slot used for matching

Return:

import("./item_acceptor").ItemAcceptorSlot

public getFakeEjectorSlot(): import("./item_ejector").ItemEjectorSlot source

Returns fake acceptor slot used for matching

Return:

import("./item_ejector").ItemEjectorSlot

public transformBeltToLocalSpace(progress: number): Vector source

Converts from belt space (0 = start of belt ... 1 = end of belt) to the local belt coordinates (-0.5|-0.5 to 0.5|0.5)

Params:

NameTypeAttributeDescription
progress number

Return:

Vector