User Tools

Site Tools


api:mandate

MANDATE

Abstract class
Extendable
Category: Data

Cloneable

Properties


AssetMandate

Runtime only, Savegame


ResourceListNeeded

Runtime only, Savegame


AssignedVillager

Runtime only, Savegame

  • Expected: pair of asset ID and component data type

IsDisabled

Runtime only, Savegame

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

Functions


initialize

void initialize(mandateType)

Call after creation of your instance

Name Type Description
mandateType MANDATE_TYPE

init

Virtual function

void init()

This is called on load of the game


update

Virtual function

void update(level)

Name Type Description
level LEVEL

startMandate

Virtual function

void startMandate()

This is called when the Bailiff starts this mandate


onStartClickCallback

Virtual function

void onStartClickCallback(assetRelatedJob)

This is called when you click on the \'start\' button of the mandate in the Mandate Window

Name Type Description
assetRelatedJob JOB

getCurrentStateText

Virtual function

string getCurrentStateText()


getDurationInSec

float getDurationInSec()


getRemainingTime

float getRemainingTime()


getCost

addMandateCostModifier

void addMandateCostModifier(costMultiplicator)

Name Type Description
costMultiplicator float

removeMandateCostModifier

void removeMandateCostModifier(costMultiplicator)

Name Type Description
costMultiplicator float

addMandateTimeModifier

void addMandateTimeModifier(timeMultiplicator)

Name Type Description
timeMultiplicator float

removeMandateTimeModifier

void removeMandateTimeModifier(timeMultiplicator)

Name Type Description
timeMultiplicator float

decreaseRemainingTime

void decreaseRemainingTime(deltaTime)

Name Type Description
deltaTime float

getRemainingTimeRatio

float getRemainingTimeRatio()


isRequiringBailiff

boolean isRequiringBailiff()


getAssignedVillager

COMP_VILLAGER getAssignedVillager()


setAssignedVillager

void setAssignedVillager(assignedVillager)

Name Type Description
assignedVillager COMP_VILLAGER

isEnabled

boolean isEnabled()


isActive

boolean isActive()


isDisabled

boolean isDisabled()


setEnabled

void setEnabled(isEnabled)

Name Type Description
isEnabled boolean

addDelayBeforeEnabled

void addDelayBeforeEnabled(timeDelay [, disableMandate])

Name Type Description
timeDelay float
disableMandate boolean

getDelayBeforeEnabledInDays

integer_and_unsigned_integer getDelayBeforeEnabledInDays()


cancelMandate

Virtual function

void cancelMandate()


completeMandate

Virtual function

void completeMandate()


getDelayBeforeEnabledTimeRatio

float getDelayBeforeEnabledTimeRatio()


getDelayBeforeEnabled

float getDelayBeforeEnabled()


isValid

Events


ON_MANDATE_STATE_CHANGED

ON_MANDATE_STATE_CHANGED() Call this event when you update your mandate. This will update the status string in the UI.

api/mandate.txt · Last modified: 2024/02/06 13:53 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki