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

Blueprint

Static Method Summary

Static Public Methods
public static

fromUids(root: GameRoot, uids: Array<number>): *

Creates a new blueprint from the given entity uids

Constructor Summary

Public Constructor
public

constructor(entities: Array<Entity>)

Member Summary

Public Members
public
public get

layer: Layer: *

Returns the layer of this blueprint

Method Summary

Public Methods
public

canAfford(root: GameRoot): *

public

canPlace(root: GameRoot, tile: Vector): *

Checks if the blueprint can be placed at the given tile

public

draw(parameters: DrawParameters)

Draws the blueprint at the given origin

public

getCost(): *

Returns the cost of this blueprint in shapes

public

Rotates the blueprint counter clock wise

public

Rotates the blueprint clockwise

public

tryPlace(root: GameRoot, tile: Vector): *

Attempts to place the blueprint at the given tile

Static Public Methods

public static fromUids(root: GameRoot, uids: Array<number>): * source

Creates a new blueprint from the given entity uids

Params:

NameTypeAttributeDescription
root GameRoot
uids Array<number>

Return:

*

Public Constructors

public constructor(entities: Array<Entity>) source

Params:

NameTypeAttributeDescription
entities Array<Entity>

Public Members

public entities: * source

public get layer: Layer: * source

Returns the layer of this blueprint

Return:

Layer

Public Methods

public canAfford(root: GameRoot): * source

Params:

NameTypeAttributeDescription
root GameRoot

Return:

*

public canPlace(root: GameRoot, tile: Vector): * source

Checks if the blueprint can be placed at the given tile

Params:

NameTypeAttributeDescription
root GameRoot
tile Vector

Return:

*

public draw(parameters: DrawParameters) source

Draws the blueprint at the given origin

Params:

NameTypeAttributeDescription
parameters DrawParameters

public getCost(): * source

Returns the cost of this blueprint in shapes

Return:

*

public rotateCcw() source

Rotates the blueprint counter clock wise

public rotateCw() source

Rotates the blueprint clockwise

public tryPlace(root: GameRoot, tile: Vector): * source

Attempts to place the blueprint at the given tile

Params:

NameTypeAttributeDescription
root GameRoot
tile Vector

Return:

*