Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: QuestObjective

[17:7] extends: FxObj

Wraps FXGL's QuestObjective, a single goal inside a Quest. Each objective watches a named world property and transitions through ACTIVE, COMPLETED, or FAILED states. Time-limited objectives also expose a remaining-time observable that ticks down each frame. Aussom users typically obtain a QuestObjective from Quest.addIntObjective / Quest.addBooleanObjective rather than constructing one directly.

Methods

  • QuestObjective ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing QuestObjective AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a QuestObjective.
    • @r A new wrapper.
  • getDescription ()

    Returns the objective's description.

    • @r A string.
  • getExpireDuration ()

    Returns the objective's expire duration in seconds. 0.0 means no time limit.

    • @r A double in seconds.
  • getState ()

    Returns the current state name ("ACTIVE", "COMPLETED", "FAILED").

    • @r A string.
  • stateProperty ()

    Returns the underlying state ObjectProperty for binding.

    • @r An AussomJavaObject around an ObjectProperty.
  • getTimeRemaining ()

    Returns the remaining time in seconds (for time-limited objectives). 0.0 for unlimited objectives.

    • @r A double in seconds.
  • timeRemainingProperty ()

    Returns the underlying time-remaining ReadOnlyDoubleProperty for binding to a timer label.

    • @r An AussomJavaObject around a ReadOnlyDoubleProperty.
  • complete ()

    Marks the objective complete immediately.

    • @r this object
  • fail ()

    Marks the objective failed immediately.

    • @r this object
  • reactivate ()

    Returns a completed or failed objective to the active state.

    • @r this object