Building Class

Inherits: GameObject

Properties
actionRadius actualCellCount angle animalCfg animalCount area buildNow buildPercent buildTime buildTimeMax buildingCenter buildingHeight capacity capacityDefault cellCount cellSize cellsPerBuilder cellsPerWorker conceivingBabyChance craftRecipes curResourceCount damaged description durability durabilityMax expeditionEndText expeditionTime extinguishWater flammable foundationArea freeSpace globalMaxWorkerCount growShare happiness harvestCount humidity insideCount integrity lengthCells lengthDefault livingCount luafuncNames matrix maxAnimalCount maxResourceCount maxVisitors maxWorkerCount modelOffsetDefault name normalHumidity oBB obstableCount paused plantCfg plantType plantWorkStatus pos3D profession resourcesToBuilding resourcesToUpgrade state storageClass storageEmpty targetForEnemies terramorhingBuilding terramorhingZone transportWayCount type upgradeDescription upgradeTimeMax visitorCount water waterMax widthCells widthDefault workTimeScale workerCount working

Functions
GetPlantCell GetPlantCellCount StartUpgrade addAdditionCollision addAnimal addBrush addBuff addCollisionQuad addCollisionTriangle addCraftRecipes addEventListener addFence addGenerator addLight addPivot addTransportWay addVisitor addWorker build calcFuncBitMask canDepositResource canExtractResource canReach cleanupBrushes cleanupLights clearCollisions clearFence clearModelSlot clearResourcesLimits clearStorage closeWindow createAnimal createDecorOnAir createDecorOnAirRotateXYZ createDecorOnAirTurn createDecorOnGround createDecorOnGroundMatrix createDecorOnGroundOffsetRotate createDecorOnGroundRotate createDecorOnGroundRotateXYZ createFirewood createFood createLight createLightOnGround createLightSmall createLightSmallOnGround createModule createModuleArray createModuleOnGround createResourceArea createResourceBuildArea createSmolderCoal createTorchLight createWindow damage data deleteModule depositResource doEvent enableFire enableSmoke enoughResourcesToCraft enter exit extinguisFire extractResource generateResourceBuildArea getActualCellIndex getAnimal getCellByPos getDoorPosition getFilterSequence getFreeWorkerPivot getFuncBitMask getPickReservation getPivot getPivots getPutReservation getResourceFree getResourceLimit getResourceStored getTerrainDelta getTerrainHeight0 getTransportWay getTransportWayByUID getVisitor getWorkMode getWorkStatus getWorker haveBuff haveDoor haveFence haveTerramorhingWork hideIcon horizontalBeds initFence instantlyBuild instantlyHarvest isConsume isIconVisible isNormalWorking isSizableBuilding loadPrefab logUI missingResourcesToCraft needEnter needResources needResourcesToBuild notifyListeners onHeightCalculation onPivotsGeneration planeBuilderPrepareBuild playSound rand randReset refreshAllResStatistic refreshResStatistic removeAdditionCollision removeAnimal removeBrush removeEventListener removeLight removeTransportWay removeVisitor removeWorker repair resetWorkStatus resourcesTransfer retrieveResource setBrushTransform setEventNotifications setFunctionActive setIconTooltip setLightTransform setPause setResourceCount setResourceLimit setStatistic setStorageCapacity setUpdateEmitterFlag setVisibleIcon setWorkMode setWorkStatus showIcon showWindow startDestroy startFire takeAwayWindowFrom toggleStatus unwantedResourcesToCraft updateBaseIcons updateBuild updateFence updateStorageStatistic

.actionRadius
Type: number [Read Only] Returns action radius of building from config if applicable. Otherwise returns 0.

.actualCellCount
Type: number [Read Only] Number of plant cells that actually contains seedlings (for planting buildings only) See getActualCellIndex for more info

.angle
Type: number [Read Only] Rotation angle of building

.animalCfg
Type: AnimalConfig Animal config (for pasture and stable buildings)

.animalCount
Type: number [Read Only] Current animal count in building

.area
Type: BuildingArea [Read Only] Returns building area

.buildNow
Type: boolean [Read Only] Check if there are some construction (or deconstruction) work in building (includes terramorphing)

.buildPercent
Type: number Percent count of construction process. Same as integrity * 100

.buildTime
Type: number [Read Only] Amount of work (or time) has been spended already

.buildTimeMax
Type: number [Read Only] Amount of work (or time) needed to spend for build

.buildingCenter
Type: Vector2 [Read Only] Builidng center point in world space (3D-position)

.buildingHeight
Type: number [Read Only] Returns current height of building in meters Can change over time during construction.

.capacity
Type: number [Read Only] Returns total amount of resources that building can store

.capacityDefault
Type: number [Read Only] Returns default (unchanged) capacity for building of this type

.cellCount
Type: number [Read Only] Number of cells for buildings that have cells grid Return 1 for non-cells buildings

.cellSize
Type: number [Read Only] Size of cell for buildings that have cell grid

.cellsPerBuilder
Type: number [Read Only] Number of cells per builder worker in building

.cellsPerWorker
Type: number [Read Only] Number of cells per worker in building

.conceivingBabyChance
Type: number [Read Only] Chance of conceiving from 0 to 100 (from building config)

.craftRecipes
Type: table [Read Only] Returns table of recipe names in this building

.curResourceCount
Type: number [Read Only] Current amount of crop resources available to harvest (for planting buildings only)

.damaged
Type: boolean [Read Only] Checks if building is damaged. That is, if building current durability is less then durabilityMax

.description
Type: BuildingConfig [Read Only] Building config. It contains various parameters for given kind of building

.durability
Type: number [Read Only] Current durablilty (toughness) of building. You can think about it like current �health points� of building. Use .durabilityMax property to know maximum value.

.durabilityMax
Type: number [Read Only] Durablilty (toughness) of building at fully constructed state. You can think about it like maximum �health points� of building

.expeditionEndText
Type: string [Read Only] End expedition time (season and year) in text form (for harbor buildings only)

.expeditionTime
Type: number [Read Only] Timed that passed since expedition start in milliseconds (for harbor buildings only)

.extinguishWater
Type: number Returns current number of water units that spend for firefighting. Total number of units needed to extinguish the fire available via extinguishCount field of BuildingConfig. Set current number of water units that spend for firefighting. Total number of units needed to extinguish the fire available via extinguishCount field of BuildingConfig.

.flammable
Type: boolean [Read Only] Check if building if flammable

.foundationArea
Type: BuildingArea [Read Only] Object that describe foundation area of building

.freeSpace
Type: number [Read Only] Returns free space of storage (total capacity minus amount of stored resources)

.globalMaxWorkerCount
Type: number [Read Only] Max count of workers (or builders) that can be set for this building in current moment

.growShare
Type: number [Read Only] Proceeded share of grow and ripen (for planting buildings only)

.happiness
Type: number [Read Only] Hapiness that this building gives (from building config)

.harvestCount
Type: number Number of harvests that available from grown plant (for planting buildings only)

.humidity
Type: number [Read Only] Current humidity on plantation (for planting buildings only)

.insideCount
Type: number [Read Only] Number of living objects that currently inside builidng

.integrity
Type: number Integrity is completeness of construction (ratio of completed to required). Vary from 0.0 to 1.0. Not to be confused with a durability.

.lengthCells
Type: number [Read Only] Row count of cells for buildings that have cells grid Return 1 for non-cells buildings

.lengthDefault
Type: number [Read Only] Physical length of building at map (in meters)

.livingCount
Type: number [Read Only] Returns count of house residents

.luafuncNames
Type: table [Read Only] Table with names of lua functions for this building

.matrix
Type: glm::mat4 [Read Only] Transformation matrix of building

.maxAnimalCount
Type: number [Read Only] Maximum allowed number of animals in building

.maxResourceCount
Type: number [Read Only] Maximum amount of crop resources that can ripe (for planting buildings only)

.maxVisitors
Type: number [Read Only] Maximum allowed number of visitors in building

.maxWorkerCount
Type: number Maximum allowed number of workers in building

.modelOffsetDefault
Type: Vector2 [Read Only] Returns default model offset (center point)

.name
Type: string [Read Only] Name of building (from building config)

.normalHumidity
Type: boolean [Read Only] Check if there are normal humidity on plantation (for planting buildings only)

.oBB
Type: OBB [Read Only]

.obstableCount
Type: number [Read Only] Obstacle count on building area at current moment

.paused
Type: boolean [Read Only] Checks if building is paused Citizens doesn't build and doesn't work at paused building

.plantCfg
Type: PlantConfig [Read Only] Config of current plant culture (for planting buildings only)

.plantType
Type: string Name of plant culture (for planting buildings only)

.plantWorkStatus
Type: number [Read Only] Plantation state. One of PlantState values (for planting buildings only)

.pos3D
Type: Vector2 [Read Only] Position in 3-dimensional space

.profession
Type: string [Read Only] Name of workers profession (from building config)

.resourcesToBuilding
Type: table [Read Only] Returns key-value table of resources required to construct this building. For instance: {  stone = 10, ore = 5, clay = 2 }

.resourcesToUpgrade
Type: table [Read Only] Returns key-value table of resources required to upgrade. For instance: {  stone = 10, ore = 5, clay = 2 }

.state
Type: number [Read Only] State of building. Return one of BildingState values

.storageClass
Type: number [Read Only] Storage class of building (from building config) Returns one of StorageClass values

.storageEmpty
Type: boolean [Read Only] Checks if there are any resources in storage

.targetForEnemies
Type: boolean [Read Only] Check if the building is target for enemies (like vikings)

.terramorhingBuilding
Type: boolean [Read Only] Check if it is regular building with some unfinished terramorphing work

.terramorhingZone
Type: boolean [Read Only] Check if it is terramorhing area without actual constructions

.transportWayCount
Type: number [Read Only] Get trasport way count (for stable buildings only)

.type
Type: BuildingType [Read Only] Building type

.upgradeDescription
Type: BuildingConfig [Read Only] Building config of upgraded version of building

.upgradeTimeMax
Type: number [Read Only] Amount of work (or time) needed to spend for upgrade

.visitorCount
Type: number [Read Only] Current visitor count in building

.water
Type: number Amount of water on plantation (for planting buildings only)

.waterMax
Type: number [Read Only] Maximum amount of water on plantation (for planting buildings only)

.widthCells
Type: number [Read Only] Column count of cells for buildings that have cells grid Return 1 for non-cells buildings

.widthDefault
Type: number [Read Only] Physical width of building at map (in meters)

.workTimeScale
Type: number [Read Only] Returns work time scale of building from its config. Default value is 1.

.workerCount
Type: number [Read Only] Current worker count in building

.working
Type: boolean [Read Only] Check if building is functioning

GetPlantCell
function GetPlantCell(index number ) -> PlantCell Returns plant cell by its index number (for planting buildings only)

GetPlantCellCount
function GetPlantCellCount -> number Number of plant cells (for planting buildings only)

StartUpgrade
function StartUpgrade Starts reconstruction process to upgrade building.

addAdditionCollision
function addAdditionCollision(uid UID, collisionPath string ) Add addition collision uid: uid that will be associated with collision collisionPath: path to prefab file that contains collision

addAnimal
function addAnimal(animal Animal ) Adds animal to building

addBrush
function addBrush(prefabPath string ) -> UID Add new prefab to building prefabPath: path to prefab file

addBuff
function addBuff(name string ) Add beneficial effect by name

addCollisionQuad
function addCollisionQuad(p1 Vector2, p2 Vector2 , p3 Vector2 , p4 Vector2 )

addCollisionTriangle
function addCollisionTriangle(p1 Vector2, p2 Vector2 , p3 Vector2 )

addCraftRecipes
function addCraftRecipes(recipeName string ) Adds craft recipe to building's recipes list by name

addEventListener
function addEventListener(listener)

addFence
function addFence(from, to, prefabs)

addGenerator
function addGenerator(name string, a Vector2 , b Vector2 , c Vector2 , count number )

addLight
function addLight(pos Vector2, radius number , color Vector2 , deprecated number ) -> UID Add new light source on builiding pos: 3D position of light source radius: radius of light color: color of light. Represented by 3-component vector (rgb-values encoded in xyz components corresponding) deprecated: deprecated parameter. leave it 0

addPivot
function addPivot(name string, pos Vector2 , dir Vector2 ) Add new pivot to building name: pivot name pos: pivot position dir: pivot direction

addTransportWay
function addTransportWay(fromUid UID, toUid UID , resourceName string , type TransportWayType , uid UID , pause boolean ) -> boolean Add new trasport way (for stable buildings only) fromUid: uid of building where transport way starts from toUid: uid of building where transport way leads to resourceName: name of specific resource to conveyance if given (empty string otherwise) type: category of resources if specific resource isn't specified. One of TransportWayType values uid: uid that will be assigned to this transport way (optional) pause: set transport on pause if set (optional)

addVisitor
function addVisitor(human Human ) Adds human to building's visitor list

addWorker
function addWorker(h Human ) Adds worker to building

build
function build(amount number ) -> boolean Increases construction progress to specified amount (or time) of work. Use buildTime and buildTimeMax properties to know current and required amount of work for construction.

calcFuncBitMask
function calcFuncBitMask

canDepositResource
function canDepositResource(resourceName string, count number ) -> boolean Checks if you can add specified amount of resource to building (if building can store resources of that type and there are enough space) resourceName: name of resource to add count: count of resource to add returns true if addition is possible

canExtractResource
function canExtractResource -> boolean Checks posibility to extract one resource from ground on the building's territory. Type of resource is given at config by extractDepositType field.

canReach
function canReach(obj LiveObject ) -> boolean Check if specified live object can reach building

cleanupBrushes
function cleanupBrushes Remove all prefabs from building

cleanupLights
function cleanupLights Remove all light sources from building

clearCollisions
function clearCollisions

clearFence
function clearFence

clearModelSlot
function clearModelSlot(UIDname)

clearResourcesLimits
function clearResourcesLimits Reset all limit type for resources

clearStorage
function clearStorage Remove all stored resources

closeWindow
function closeWindow

createAnimal
function createAnimal(animalType string ) Create animal of given type in building

createDecorOnAir
function createDecorOnAir(prefabPath, X, Y, Z)

createDecorOnAirRotateXYZ
function createDecorOnAirRotateXYZ(mat, prefabPath)

createDecorOnAirTurn
function createDecorOnAirTurn(rotAngle, prefabPath, X, Y, Z)

createDecorOnGround
function createDecorOnGround(prefabPath, X, Y, Z)

createDecorOnGroundMatrix
function createDecorOnGroundMatrix(transformMatrix, prefabPath)

createDecorOnGroundOffsetRotate
function createDecorOnGroundOffsetRotate(rotAngle, prefabPath, X, Y, Z)

createDecorOnGroundRotate
function createDecorOnGroundRotate(rotAngle, prefabPath, X, Y, Z)

createDecorOnGroundRotateXYZ
function createDecorOnGroundRotateXYZ(rotAngleX, rotAngleY, rotAngleZ, prefabPath, X, Y, Z)

createFirewood
function createFirewood(Angle, X, Y, Z)

createFood
function createFood(Anglefood, Xfood, Yfood, Zfood)

createLight
function createLight(UIDname, X, Y, Z)

createLightOnGround
function createLightOnGround(UIDname, X, Y, Z)

createLightSmall
function createLightSmall(UIDname, X, Y, Z)

createLightSmallOnGround
function createLightSmallOnGround(UIDname, X, Y, Z)

createModule
function createModule(b_percent, UIDname, mat, prefabPath)

createModuleArray
function createModuleArray(BuildModules)

createModuleOnGround
function createModuleOnGround(b_percent, UIDname, mat, prefabPath)

createResourceArea
function createResourceArea(pos Vector2, widthSize number , lengthSize number , resRowCount number , maxResInPack number , terrainHeight boolean , widthSpace number , lengthSpace number ) Create resource area

createResourceBuildArea
function createResourceBuildArea(pos Vector2, widthSize number , lengthSize number , resRowCount number , maxResInPack number , terrainHeight boolean , widthSpace number , lengthSpace number ) Create resource build area

createSmolderCoal
function createSmolderCoal(X, Y, Z)

createTorchLight
function createTorchLight(UIDname, X, Y, Z)

createWindow
function createWindow

damage
function damage(amount number, force boolean ) Decreases current durability (health point) of building. If it goes to zero building will be destroyed. amount: amount of durability to remove force: force damage even if config prevent it

data
function data

deleteModule
function deleteModule(b_percent, UIDname, mat, prefabPath)

depositResource
function depositResource(resourceName string, count number ) -> boolean Add specified amount of resource to building storage resourceName: name of resource to add count: count of resource to add returns true if success

doEvent
function doEvent(s string, p1 number , p2 number )

enableFire
function enableFire(value boolean ) Enable (or disable) fire effect for building value: state of effect

enableSmoke
function enableSmoke(value boolean ) Enable (or disable) smoke effect for building value: state of effect

enoughResourcesToCraft
function enoughResourcesToCraft(cfg ResourcesConfig ) -> boolean Check if available resources are enough to craft

enter
function enter(liveObject LiveObject ) -> boolean Marks worker or animal as located inside building. Sends various events to building and system, hide worker if needed and so on. Can fail if building doesn't allow entering, has invalid state or at fire. obj: live object to mark return true if successed

exit
function exit(liveObject LiveObject ) Marks worker or animal as no longer located inside building. Sends various events to building and system, hide worker if needed and so on. obj: live object to mark

extinguisFire
function extinguisFire Increase firefighting progress by 1 unit. Total number of units needed to extinguish the fire available via extinguishCount field of BuildingConfig.

extractResource
function extractResource Extract one resource from ground on the building's territory. Type of resource is given by extractDepositType field of BuildingConfig.

generateResourceBuildArea
function generateResourceBuildArea

getActualCellIndex
function getActualCellIndex(index number ) -> number Get plant cell index by seedling index (for planting buildings only) There are two arrays in planting buildings: 1. Array of all potential plant cells (static in time) 2. Array of plant cells that actually contains seedlings (can change over time) This function takes index of second array (you can use getActualCellCount to determine its length) and convert it to corresponding index in first array

getAnimal
function getAnimal(index number ) -> Animal Returns building's animal by its index

getCellByPos
function getCellByPos(pos Vector2 ) -> number Returns cell index in building that located at given pos If there no such cells in building return false

getDoorPosition
function getDoorPosition(liveObject LiveObject ) -> Vector2 Returns 3D world position that can be interpreted as entrance of building at any given time. Always returns best position for interact with building even if there are no door. liveObject: if given, returns nearest door position to this live object (optional)

getFilterSequence
function getFilterSequence

getFreeWorkerPivot
function getFreeWorkerPivot(name string, human Human ) -> Pivot Returns free pivot with given name Free pivot that isn't occupied or reserved by workers name: pivot name human: human that can reach pivot position

getFuncBitMask
function getFuncBitMask

getPickReservation
function getPickReservation(resourceName string ) -> number Returns amount of specified resource that reserved to pull out (that is, it will be removed from building soon) resourceName: name of resource

getPivot
function getPivot(name string ) -> Pivot Returns pivot (first one) by name

getPivots
function getPivots(name string ) -> std::vectorBuilding:: Returns table of pivots with given name

getPutReservation
function getPutReservation(resourceName string ) -> number Returns amount of specified resource that reserved to put in (that is, it will be added to building soon) resourceName: name of resource

getResourceFree
function getResourceFree(strType string ) -> number Count of specified resource that stored in this building and available to use (doesn't reserved by another workers)

getResourceLimit
function getResourceLimit(resName string ) -> number Get limit type of given resource. One of ResourceLimitProperty values

getResourceStored
function getResourceStored(strType string ) -> number Count of specified resource that stored in this building

getTerrainDelta
function getTerrainDelta(deltaUnderWaterTotal number, deltaOverWaterTotal number ) Returns two values: 1st result is amount of needed terramorphing work under water 2nd result is amount of needed terramorphing work over water

getTerrainHeight0
function getTerrainHeight0(x number, y number ) -> number Returns height of terrain at given position after terramorphing work x: x-position on map (global) y: y-position on map (global)

getTransportWay
function getTransportWay(index number ) -> TransportWay Get transport way by it index number (for stable buildings only)

getTransportWayByUID
function getTransportWayByUID(uid UID ) -> TransportWay Get trasport way by its uid (for stable buildings only)

getVisitor
function getVisitor(index number ) -> Human Returns building's visitor by its index

getWorkMode
function getWorkMode(name string ) -> string Returns current value of work mode by its name. Work modes are string settings that describe current status of various work aspects. Each setting has name and, actually, value. If setting doesn't set returns empty string.

getWorkStatus
function getWorkStatus(id number ) -> boolean Returns work status flag by its id. Work status flags are boolean values that indicate various work aspects. id: id of flag. One of BuildingStatus values.

getWorker
function getWorker(index number ) -> Human Returns building's worker by its index

haveBuff
function haveBuff(name string ) -> boolean Ckeck if building has given beneficial effect by name

haveDoor
function haveDoor -> boolean Check if building has entrance

haveFence
function haveFence

haveTerramorhingWork
function haveTerramorhingWork -> boolean Check if building has some unfinished terramorphing work

hideIcon
function hideIcon(iconType number ) Set icon of given type invisible iconType: one of BuildingIcon values

horizontalBeds
function horizontalBeds -> boolean Returns true if column count of cells grid >= row count and false otherwise

initFence
function initFence

instantlyBuild
function instantlyBuild -> boolean Immediatly complete construction process. Sets durability and integrity to max values.

instantlyHarvest
function instantlyHarvest Start harvest (for planting buildings only)

isConsume
function isConsume(resName)

isIconVisible
function isIconVisible(iconType number ) -> boolean Checks visibility of building icon of given type iconType: one of BuildingIcon values

isNormalWorking
function isNormalWorking

isSizableBuilding
function isSizableBuilding

loadPrefab
function loadPrefab(prefabPath string ) -> UID Add new prefab to building prefabPath: path to prefab file

logUI
function logUI(log string, type number , color number ) Print to event log message associated with the building. log: message to log type: type of message. Can be one of the LogType values color: color of message. Can be one of the LogColor values

missingResourcesToCraft
function missingResourcesToCraft(cfg ResourcesConfig ) -> table Returns key-value table of missing resources for craft. For instance: {  stone = 10, ore = 5, clay = 2 }

needEnter
function needEnter -> boolean Checks if building allows entering (if it has door and working normally)

needResources
function needResources -> table Returns key-value table of needed resources. It is either equivalent to needResourcesToBuild for construction yards, or result of resourcesCalculation call for functioning building, or empty table in other cases. For instance: {    stone = 10, ore = 5, clay = 2 }

needResourcesToBuild
function needResourcesToBuild -> table Returns key-value table of needed resources for building. For instance: {  stone = 10, ore = 5, clay = 2 }

notifyListeners
function notifyListeners(eventName)

onHeightCalculation
function onHeightCalculation

onPivotsGeneration
function onPivotsGeneration

planeBuilderPrepareBuild
function planeBuilderPrepareBuild(human Human ) -> number This function searches any unwanted objects (for instance, trees or resource piles) at building area and plans clearing works if needed returns 1 if function successed and worker started clearing works returns 0 if function completed normally but there are no clearing works started returns -1 if failed

playSound
function playSound(pathToFile string ) Plays given sound in 3D world position of building (needed for volume and stereo effect)

rand
function rand(min number, max number ) -> number Returns random number from [min; max] range inclusive (use building internal random generator)

randReset
function randReset Reset building internal random generator

refreshAllResStatistic
function refreshAllResStatistic

refreshResStatistic
function refreshResStatistic(resType string )

removeAdditionCollision
function removeAdditionCollision(uid UID ) Remove addition collision uid: uid associated with collision

removeAnimal
function removeAnimal(animal Animal ) Removes animal from building

removeBrush
function removeBrush(uid UID ) Remove prefab by its uid

removeEventListener
function removeEventListener(listener)

removeLight
function removeLight(uid UID ) Remove light source by its uid

removeTransportWay
function removeTransportWay(uid UID ) -> boolean Remove trasport way by its uid (for stable buildings only)

removeVisitor
function removeVisitor(human Human ) Removes human from building's visitor list

removeWorker
function removeWorker(h Human ) Removes worker from building

repair
function repair(amount number ) Restores current durability (health point) of building. Can restore durability up to durabilityMax value. amount: amount of durability to restore

resetWorkStatus
function resetWorkStatus(id number ) Disable work status flag by its id. Work status flags are boolean values that indicate various work aspects. id: id of flag. One of BuildingStatus values.

resourcesTransfer
function resourcesTransfer(w, findMarket)

retrieveResource
function retrieveResource(resourceName string, count number ) -> boolean Remove specified amount of resource from building storage resourceName: name of resource to remove count: count of resource to remove returns true if success

setBrushTransform
function setBrushTransform(uid UID, matrix glm::mat4 ) Set trasformation matrix to prefab uid: uid of light source matrix: transformation matrix

setEventNotifications
function setEventNotifications(value boolean ) Enable or disable notification for building's events listener. Don't change it except you know what you are doing.

setFunctionActive
function setFunctionActive(name string, value boolean ) -> boolean Enable or disable calls of lua function by its name List of functions for specific building available by getLuafuncNames

setIconTooltip
function setIconTooltip(iconType number, tooptipText string ) Set tooltip text for building icon of given type iconType: one of BuildingIcon values tooptipText: new tooltip text for icon

setLightTransform
function setLightTransform(uid UID, matrix glm::mat4 ) Set trasformation matrix to light source uid: uid of light source matrix: transformation matrix

setPause
function setPause(value boolean ) Pause mode Citizens doesn't build and doesn't work at paused building

setResourceCount
function setResourceCount(resourceName string, count number ) Set amount of stored resource to specified value resourceName: name of resource count: amount of resource

setResourceLimit
function setResourceLimit(resName string, value number ) Set limit type to given resource. resName: name of resource value: one of ResourceLimitProperty values

setStatistic
function setStatistic(statName string, value number )

setStorageCapacity
function setStorageCapacity(newCapacity number ) Set total amount of resources that building can store to new value

setUpdateEmitterFlag
function setUpdateEmitterFlag(flag boolean )

setVisibleIcon
function setVisibleIcon(iconType number, visible boolean ) Changes visibility of building icon of given type iconType: one of BuildingIcon values visible: visibility state

setWorkMode
function setWorkMode(name string, value string ) Work modes are string settings that describe current status of various work aspects. Each setting has name and, actually, value. name: name of work mode setting to set value: new value of work mode

setWorkStatus
function setWorkStatus(id number ) Enable work status flag by its id. Work status flags are boolean values that indicate various work aspects. id: id of flag. One of BuildingStatus values.

showIcon
function showIcon(iconType number ) Set icon of given type visible iconType: one of BuildingIcon values

showWindow
function showWindow(newSelected)

startDestroy
function startDestroy -> boolean Starts deconstucrion process of building.

startFire
function startFire Starts fire in building

takeAwayWindowFrom
function takeAwayWindowFrom(building)

toggleStatus
function toggleStatus(statusType)

unwantedResourcesToCraft
function unwantedResourcesToCraft(cfg ResourcesConfig ) -> table Returns key-value table of unwanted resources for craft. For instance: {  stone = 10, ore = 5, clay = 2 }

updateBaseIcons
function updateBaseIcons Update visibility state of main building icons

updateBuild
function updateBuild(w, findWorkPlace)

updateFence
function updateFence(fenceFunc)

updateStorageStatistic
function updateStorageStatistic