User Tools

Site Tools


api:comp_workplace

COMP_WORKPLACE

Properties


AssignedWorkerList

Serialized, Savegame

  • Type: list<COMP_VILLAGER>
  • Expected: list of pairs of asset ID and component data type

ActivelyWorkingVillagerList

Serialized, Savegame

  • Type: list<COMP_VILLAGER>
  • Expected: list of pairs of asset ID and component data type

IsPaused

Serialized, Savegame

  • Type: boolean
  • Expected: boolean value
  • Default value: false

CurrentProductionAmountList

Serialized, Savegame

  • Type: list<float>
  • Expected: list of float values

Functions


update

Virtual function

void update()


setWorkplaceData

Virtual function

void setWorkplaceData(workplaceData)

Name Type Description
workplaceData BUILDING_FUNCTION_WORKPLACE

registerVillager

Virtual function

boolean registerVillager(villager)

Name Type Description
villager COMP_VILLAGER

unregisterVillager

Virtual function

boolean unregisterVillager(villager)

Name Type Description
villager COMP_VILLAGER

getGatherableTargetPosition

Virtual function

void getGatherableTargetPosition(villager, resource, resourcePosition, aroundResourcePosition)

Name Type Description
villager COMP_VILLAGER
resource COMP_RESOURCE_CONTAINER
resourcePosition BEHAVIOR_TREE_DATA_LOCATION
aroundResourcePosition BEHAVIOR_TREE_DATA_LOCATION

Events


ON_ASSIGNED_WORKER_CHANGED

ON_ASSIGNED_WORKER_CHANGED(COMP_VILLAGER)


ON_WORKPLACE_PAUSED

ON_WORKPLACE_PAUSED(boolean)


ON_WORKPLACE_PRODUCED

ON_WORKPLACE_PRODUCED(RESOURCE_COLLECTION_VALUE)


ON_WORKPLACE_STATUS_UPDATE

ON_WORKPLACE_STATUS_UPDATE()

api/comp_workplace.txt · Last modified: 2022/02/15 14:50 (external edit)