Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

API for managing missions and their objectives.

 

properties

 

Mission

.name – name of mission (string)

.date – date on which the mission starts (date object)

.id – mission id (string)

.status – true = mission successful, false = mission failed, undefined/null = in progress (default: undefined)

.autoComplete – if true, mission success occurs when all mandatory objectives are met (default: false)

.timeLimit – get/set time limit, null = no time limit

...

.onSuccess() – triggered when all mandatory objectives achievedmission successful

.onFailure() – triggered when mission failed

...

.progress – number of tasks completed

.inc([data]) – increment progress, optionally pass in data for event handler

.optional – objective optional? true/false (default: false)

...

.onProgress() – triggered when done changes

.onCompleteonCompleted() – triggered when the objective is completed

.onFailureonFailed() – triggered when the objective is failed

.onEnableonEnabled() – triggered when the objective is enabled or

.onDisabled() – triggered when the objective is disabled