GearBlocks
The GearBlocks Lua scripting API
Public Member Functions | Properties | List of all members
SmashHammer.GearBlocks.Construction.Construction Class Reference

A construction is made up of one or more parts assembled together. More...

Inheritance diagram for SmashHammer.GearBlocks.Construction.Construction:
SmashHammer.GearBlocks.Construction.IConstruction SmashHammer.GearBlocks.Graphics.IRenderableToTexture

Public Member Functions

bool IsSelectableBy (byte playerID)
 Is the construction selectable by a player?
 
bool IsBuildableBy (byte playerID)
 Is the construction buildable by a player?
 
BoundsProxy CalcWorldBounds (bool activeStageOnly=false)
 Calculate the world space bounds of the construction.
 
void AddPartsToCatalogue (IDictionary< ulong, ushort > partCatalogue)
 Add the construction's part(s) to a catalogue.
 
bool IsSelectableBy (byte playerID)
 Is the construction selectable by a player?
 
bool IsBuildableBy (byte playerID)
 Is the construction buildable by a player?
 
IPart GetPart (ushort idx)
 Get a part from the construction.
 
void SetActiveStage (ushort stageIdx)
 Sets the construction's active stage.
 
BoundsProxy CalcWorldBounds (bool activeStageOnly=false)
 Calculate the world space bounds of the construction.
 
Vector3Proxy CalcWorldCentreOfMass ()
 Calculate the centre of mass of the construction in world space.
 
void AddPartsToCatalogue (IDictionary< ulong, ushort > partCatalogue)
 Add the construction's part(s) to a catalogue.
 

Properties

ushort NumComposites [get]
 Number of composites in the construction.
 
ushort NumParts [get]
 Number of parts in the construction.
 
bool IsAtomic [get]
 Is the construction atomic?
 
byte CharacterPlayerID [get, set]
 The construction's character player ID.
 
byte BuilderPlayerID = NetworkConnect.nullPlayerID [get, set]
 The construction's builder player ID.
 
bool IsPlayerCharacter [get]
 Is the construction a player character?
 
bool IsFrozen = false [get]
 Is the construction frozen?
 
bool IsInvulnerable = false [get, set]
 Is the construction invulnerable?
 
ushort ActiveStageIdx = 0xffff [get]
 The construction's active stage index.
 
List< PartDescriptorParts = new() [get]
 The construction's part(s).
 
- Properties inherited from SmashHammer.GearBlocks.Construction.IConstruction
ushort ID [get]
 The construction's scene ID.
 
ushort NumComposites [get]
 Number of composites in the construction.
 
ushort NumParts [get]
 Number of parts in the construction.
 
bool IsAtomic [get]
 Is the construction atomic?
 
IEnumerable< IPartParts [get]
 The construction's part(s).
 
TextureProxy PreviewImage [get]
 The construction's preview image.
 
byte CharacterPlayerID [get]
 The construction's character player ID.
 
byte BuilderPlayerID [get]
 The construction's builder player ID.
 
bool IsPlayerCharacter [get]
 Is the construction a player character?
 
bool IsFrozen [get]
 Is the construction frozen?
 
bool IsInvulnerable [get]
 Is the construction invulnerable?
 
float Mass [get]
 The construction's mass.
 
ushort MaxStageIdx [get]
 The construction's maximum stage index.
 
ushort ActiveStageIdx [get]
 The construction's active stage index.
 

Detailed Description

A construction is made up of one or more parts assembled together.

Available in Lua via the "Constructions" global, for example:

local constructionID = 0
local construction = Constructions.GetInstance( constructionID )
Do something with the construction here.
for construction in Constructions.Instances do
Do something with the construction here.
end

Member Function Documentation

◆ IsSelectableBy()

bool SmashHammer.GearBlocks.Construction.Construction.IsSelectableBy ( byte  playerID)

Is the construction selectable by a player?

Parameters
playerIDThe ID of the player.
Returns
true if this construction is selectable; otherwise, false.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ IsBuildableBy()

bool SmashHammer.GearBlocks.Construction.Construction.IsBuildableBy ( byte  playerID)

Is the construction buildable by a player?

Parameters
playerIDThe ID of the player.
Returns
true if this construction is buildable; otherwise, false.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ CalcWorldBounds()

BoundsProxy SmashHammer.GearBlocks.Construction.Construction.CalcWorldBounds ( bool  activeStageOnly = false)

Calculate the world space bounds of the construction.

Parameters
activeStageOnlySet to true to encapsulate the parts in the construction's active stage only, or false for the whole construction.
Returns
The calculated bounds.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ AddPartsToCatalogue()

void SmashHammer.GearBlocks.Construction.Construction.AddPartsToCatalogue ( IDictionary< ulong, ushort >  partCatalogue)

Add the construction's part(s) to a catalogue.

Parameters
partCatalogueA catalogue of parts to fill from this construction.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

Property Documentation

◆ NumComposites

ushort SmashHammer.GearBlocks.Construction.Construction.NumComposites
get

Number of composites in the construction.

The number of composites this construction has.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ NumParts

ushort SmashHammer.GearBlocks.Construction.Construction.NumParts
get

Number of parts in the construction.

The number of parts this construction has.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ IsAtomic

bool SmashHammer.GearBlocks.Construction.Construction.IsAtomic
get

Is the construction atomic?

true if this has only one part; otherwise, false.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ CharacterPlayerID

byte SmashHammer.GearBlocks.Construction.Construction.CharacterPlayerID
getset

The construction's character player ID.

The ID of the player for which this construction is the player character, if applicable. Otherwise null (0xff).

See also
IsPlayerCharacter

Also see IsPlayerCharacter.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ BuilderPlayerID

byte SmashHammer.GearBlocks.Construction.Construction.BuilderPlayerID = NetworkConnect.nullPlayerID
getset

The construction's builder player ID.

The ID of the player that froze this construction, if currently frozen. Otherwise null (0xff).

See also
IsFrozen

Also see IsFrozen.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ IsPlayerCharacter

bool SmashHammer.GearBlocks.Construction.Construction.IsPlayerCharacter
get

Is the construction a player character?

true if this construction a player character; otherwise, false.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ IsFrozen

bool SmashHammer.GearBlocks.Construction.Construction.IsFrozen = false
get

Is the construction frozen?

true if this construction is frozen; otherwise, false.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ IsInvulnerable

bool SmashHammer.GearBlocks.Construction.Construction.IsInvulnerable = false
getset

Is the construction invulnerable?

true if this construction invulnerable to damage; otherwise, false.

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ ActiveStageIdx

ushort SmashHammer.GearBlocks.Construction.Construction.ActiveStageIdx = 0xffff
get

The construction's active stage index.

The index of the construction's active kit building stage (determines which parts are active).

Implements SmashHammer.GearBlocks.Construction.IConstruction.

◆ Parts

List<PartDescriptor> SmashHammer.GearBlocks.Construction.Construction.Parts = new()
get

The construction's part(s).

A list of this construction's parts.

Implements SmashHammer.GearBlocks.Construction.IConstruction.