The buildings can be either player-built or part the central building defining the role of a zone.

Variables

kind:BuildingKind

[HostOnly] The kind of building, define the role and appearance of a building.

read onlyoreAmount:Null<Float>

The quantity of ore the building contains. If the building isn't an ore deposit, will return null.

Methods

@:value({ manualDestroy : false })destroy(manualDestroy:Bool = false):Void

[HostOnly] Destroy the building, with sound and visual effect.

Parameters:

manualDestroy

[Optional] True to destroy the building as it was destroyed by the owner, recovering resources and other things.

isActive():Bool

Is the building active. Used for rare toggleable buildings like the Gate of Muspell or Ancient Graveyard.

Returns:

Bool

isUpgraded():Bool

Tell if the building has been upgraded.

Returns:

Bool

quickDestroy():Void

[HostOnly] Remove the building and fix the area's ground as it never existed.

remove():Void

[HostOnly] Immediately remove the building without any effects

setActive(b:Bool):Void

[HostOnly] Set the building active. Used for rare toggleable buildings like the Gate of Muspell or Ancient Graveyard. A building is considered active by default.

Parameters:

null

b

setOreAmount(amount:Float):Bool

[HostOnly] Allow to set the ore amount if the building is a natural ore deposit such as Stone or Iron.

Parameters:

amount

Returns:

Bool true if the building is an ore deposit, else false.