Home Reference Source
import {MetaAnalyzerBuilding} from 'shapez.io/js/game/buildings/analyzer.js'
public class | source

MetaAnalyzerBuilding

Extends:

MetaBuilding → MetaAnalyzerBuilding

Constructor Summary

Public Constructor
public

Method Summary

Public Methods
public
public

getDimensions(variant: string): *

public

getIsRemovable(variant: string): *

public

getIsRotateable(variant: string): *

public
public

getLayer(root: GameRoot, variant: string): Layer

Returns the edit layer of the building

public

getRenderPins(variant: string): *

public
public

getSilhouetteColor(variant: string): *

public

getSpecialOverlayRenderMatrix(rotation: number, rotationVariant: number, variant: string, entity: Entity): Array<number> | null

public

Creates the entity at the given location

public

updateVariants(entity: Entity, rotationVariant: number, variant: string)

Inherited Summary

From class MetaBuilding
public

id: *

public

computeOptimalDirectionAndRotationVariantAtTile(param0: object): {rotation: number, rotationVariant: number, connectedEntities?: Array<Entity>}

Should compute the optimal rotation variant on the given tile

public

createEntity(param0: object): *

Creates the entity without placing it

public

getAdditionalStatistics(root: GameRoot, variant: string): Array<[string, string]>

Should return additional statistics about this building

public
public

getBlueprintSprite(rotationVariant: number, variant: *): AtlasSprite

Returns a sprite for blueprints

public

getDimensions(variant: string): *

Should return the dimensions of the building

public

Whether to flip the orientation after a building has been placed - useful for tunnels.

public

Returns whether the building has the direction lock switch available

public

getId(): *

Returns the id of this building

public

Returns whether this building is removable

public

getIsReplaceable(variant: *): boolean

Returns whether this building can get replaced

public

Returns whether this building is rotateable

public

Returns whether this building is unlocked for the given game

public

getLayer(root: GameRoot, variant: string): Layer

Returns the edit layer of the building

public

Returns the placement sound

public

getPreviewSprite(rotationVariant: number, variant: *): AtlasSprite

Returns a preview sprite

public

Should return false if the pins are already included in the sprite of the building

public

Whether to rotate automatically in the dragging direction while placing

public

Whether to show a preview of the layer when placing the building

public

getSilhouetteColor(variant: string, rotationVariant: number): *

Should return a silhouette color for the map overview or null if not set

public

getSpecialOverlayRenderMatrix(rotation: number, rotationVariant: number, variant: string, entity: Entity): Array<number> | null

Can return a special interlaved 9 elements overlay matrix for rendering

public

getSprite(rotationVariant: number, variant: string): AtlasSprite

Returns the sprite for a given variant

public

Whether to stay in placement mode after having placed a building

public

Should setup the entity components

public

updateVariants(entity: Entity, rotationVariant: number, variant: string)

Should update the entity to match the given variants

Public Constructors

public constructor() source

Override:

MetaBuilding#constructor

Public Methods

public getAvailableVariants(root: GameRoot): * source

Override:

MetaBuilding#getAvailableVariants

Params:

NameTypeAttributeDescription
root GameRoot

Return:

*

public getDimensions(variant: string): * source

Should return the dimensions of the building

Override:

MetaBuilding#getDimensions

Params:

NameTypeAttributeDescription
variant string

Return:

*

public getIsRemovable(variant: string): * source

Returns whether this building is removable

Override:

MetaBuilding#getIsRemovable

Params:

NameTypeAttributeDescription
variant string

Return:

*

public getIsRotateable(variant: string): * source

Returns whether this building is rotateable

Override:

MetaBuilding#getIsRotateable

Params:

NameTypeAttributeDescription
variant string

Return:

*

public getIsUnlocked(root: GameRoot): * source

Returns whether this building is unlocked for the given game

Override:

MetaBuilding#getIsUnlocked

Params:

NameTypeAttributeDescription
root GameRoot

Return:

*

public getLayer(root: GameRoot, variant: string): Layer source

Returns the edit layer of the building

Override:

MetaBuilding#getLayer

Params:

NameTypeAttributeDescription
root GameRoot
variant string

Return:

Layer

public getRenderPins(variant: string): * source

Should return false if the pins are already included in the sprite of the building

Override:

MetaBuilding#getRenderPins

Params:

NameTypeAttributeDescription
variant string

Return:

*

public getShowLayerPreview(variant: string): * source

Whether to show a preview of the layer when placing the building

Override:

MetaBuilding#getShowLayerPreview

Params:

NameTypeAttributeDescription
variant string

Return:

*

public getSilhouetteColor(variant: string): * source

Should return a silhouette color for the map overview or null if not set

Override:

MetaBuilding#getSilhouetteColor

Params:

NameTypeAttributeDescription
variant string

Return:

*

public getSpecialOverlayRenderMatrix(rotation: number, rotationVariant: number, variant: string, entity: Entity): Array<number> | null source

Can return a special interlaved 9 elements overlay matrix for rendering

Override:

MetaBuilding#getSpecialOverlayRenderMatrix

Params:

NameTypeAttributeDescription
rotation number
rotationVariant number
variant string
entity Entity

Return:

Array<number> | null

public setupEntityComponents(entity: Entity) source

Creates the entity at the given location

Override:

MetaBuilding#setupEntityComponents

Params:

NameTypeAttributeDescription
entity Entity

public updateVariants(entity: Entity, rotationVariant: number, variant: string) source

Should update the entity to match the given variants

Override:

MetaBuilding#updateVariants

Params:

NameTypeAttributeDescription
entity Entity
rotationVariant number
variant string