====== MANDATE ====== //Abstract class//\\ **[[:custom-classes#Extendable classes|Extendable]]**\\ **Category**: Data //[[:annotations#cloneable|Cloneable]]// ===== Properties ===== ---- ==== AssetMandate ==== //[[:annotations#runtime_only|Runtime only]], [[:annotations#savegame|Savegame]]// * **Type**: ''[[:api:mandate_type|MANDATE_TYPE]]'' * **Expected**: ''asset ID'' ---- ==== ResourceListNeeded ==== //[[:annotations#runtime_only|Runtime only]], [[:annotations#savegame|Savegame]]// * **Type**: ''[[:api:resource_collection_value|RESOURCE_COLLECTION_VALUE]]'' * **Can also be built from**: ''[[:data-types#list|list]]<[[:api:resource_quantity_pair|RESOURCE_QUANTITY_PAIR]]>'' * **Expected**: ''RESOURCE_COLLECTION_VALUE value'' or ''list of RESOURCE_QUANTITY_PAIR values'' ---- ==== AssignedVillager ==== //[[:annotations#runtime_only|Runtime only]], [[:annotations#savegame|Savegame]]// * **Type**: ''[[:api:comp_villager|COMP_VILLAGER]]'' * **Expected**: ''pair of asset ID and component data type'' ---- ==== IsDisabled ==== //[[:annotations#runtime_only|Runtime only]], [[:annotations#savegame|Savegame]]// * **Type**: ''[[:data-types#boolean|boolean]]'' * **Expected**: ''boolean value'' * **Default value**: ''false'' ===== Functions ===== ---- ==== initialize ==== ''void **initialize**(//mandateType//)'' Call after creation of your instance ^ Name ^ Type ^ Description ^ | //''mandateType''// | ''[[:api:mandate_type|MANDATE_TYPE]]'' | | ---- ==== init ==== //[[:custom-classes#Extendable classes|Virtual function]]// ''void **init**()'' This is called on load of the game ---- ==== update ==== //[[:custom-classes#Extendable classes|Virtual function]]// ''void **update**(//level//)'' ^ Name ^ Type ^ Description ^ | //''level''// | ''[[:api:level|LEVEL]]'' | | ---- ==== startMandate ==== //[[:custom-classes#Extendable classes|Virtual function]]// ''void **startMandate**()'' This is called when the Bailiff starts this mandate ---- ==== onStartClickCallback ==== //[[:custom-classes#Extendable classes|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''// | ''[[:api:job|JOB]]'' | | ---- ==== getCurrentStateText ==== //[[:custom-classes#Extendable classes|Virtual function]]// ''[[:data-types#string|string]] **getCurrentStateText**()'' ---- ==== getDurationInSec ==== ''[[:data-types#float|float]] **getDurationInSec**()'' ---- ==== getRemainingTime ==== ''[[:data-types#float|float]] **getRemainingTime**()'' ---- ==== getCost ==== ''[[:api:resource_collection_value|RESOURCE_COLLECTION_VALUE]] **getCost**()'' ---- ==== addMandateCostModifier ==== ''void **addMandateCostModifier**(//costMultiplicator//)'' ^ Name ^ Type ^ Description ^ | //''costMultiplicator''// | ''[[:data-types#float|float]]'' | | ---- ==== removeMandateCostModifier ==== ''void **removeMandateCostModifier**(//costMultiplicator//)'' ^ Name ^ Type ^ Description ^ | //''costMultiplicator''// | ''[[:data-types#float|float]]'' | | ---- ==== addMandateTimeModifier ==== ''void **addMandateTimeModifier**(//timeMultiplicator//)'' ^ Name ^ Type ^ Description ^ | //''timeMultiplicator''// | ''[[:data-types#float|float]]'' | | ---- ==== removeMandateTimeModifier ==== ''void **removeMandateTimeModifier**(//timeMultiplicator//)'' ^ Name ^ Type ^ Description ^ | //''timeMultiplicator''// | ''[[:data-types#float|float]]'' | | ---- ==== decreaseRemainingTime ==== ''void **decreaseRemainingTime**(//deltaTime//)'' ^ Name ^ Type ^ Description ^ | //''deltaTime''// | ''[[:data-types#float|float]]'' | | ---- ==== getRemainingTimeRatio ==== ''[[:data-types#float|float]] **getRemainingTimeRatio**()'' ---- ==== isRequiringBailiff ==== ''[[:data-types#boolean|boolean]] **isRequiringBailiff**()'' ---- ==== getAssignedVillager ==== ''[[:api:comp_villager|COMP_VILLAGER]] **getAssignedVillager**()'' ---- ==== setAssignedVillager ==== ''void **setAssignedVillager**(//assignedVillager//)'' ^ Name ^ Type ^ Description ^ | //''assignedVillager''// | ''[[:api:comp_villager|COMP_VILLAGER]]'' | | ---- ==== isEnabled ==== ''[[:data-types#boolean|boolean]] **isEnabled**()'' ---- ==== isActive ==== ''[[:data-types#boolean|boolean]] **isActive**()'' ---- ==== isDisabled ==== ''[[:data-types#boolean|boolean]] **isDisabled**()'' ---- ==== setEnabled ==== ''void **setEnabled**(//isEnabled//)'' ^ Name ^ Type ^ Description ^ | //''isEnabled''// | ''[[:data-types#boolean|boolean]]'' | | ---- ==== addDelayBeforeEnabled ==== ''void **addDelayBeforeEnabled**(//timeDelay// [, //disableMandate//])'' ^ Name ^ Type ^ Description ^ | //''timeDelay''// | ''[[:data-types#float|float]]'' | | | //''disableMandate''// | ''[[:data-types#boolean|boolean]]'' | | ---- ==== getDelayBeforeEnabledInDays ==== ''[[:data-types#integer_and_unsigned_integer|integer_and_unsigned_integer]] **getDelayBeforeEnabledInDays**()'' ---- ==== cancelMandate ==== //[[:custom-classes#Extendable classes|Virtual function]]// ''void **cancelMandate**()'' ---- ==== completeMandate ==== //[[:custom-classes#Extendable classes|Virtual function]]// ''void **completeMandate**()'' ---- ==== getDelayBeforeEnabledTimeRatio ==== ''[[:data-types#float|float]] **getDelayBeforeEnabledTimeRatio**()'' ---- ==== getDelayBeforeEnabled ==== ''[[:data-types#float|float]] **getDelayBeforeEnabled**()'' ---- ==== isValid ==== //[[:custom-classes#Extendable classes|Virtual function]]// ''[[:data-types#boolean|boolean]] **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.