Class MapObjectives.MapObjective

java.lang.Object
mindustry.game.MapObjectives.MapObjective
Direct Known Subclasses:
MapObjectives.BuildCountObjective, MapObjectives.CommandModeObjective, MapObjectives.CoreItemObjective, MapObjectives.DestroyBlockObjective, MapObjectives.DestroyBlocksObjective, MapObjectives.DestroyCoreObjective, MapObjectives.DestroyUnitsObjective, MapObjectives.FlagObjective, MapObjectives.ItemObjective, MapObjectives.ProduceObjective, MapObjectives.ResearchObjective, MapObjectives.TimerObjective, MapObjectives.UnitCountObjective
Enclosing class:
MapObjectives

public abstract static class MapObjectives.MapObjective extends Object
Base abstract class for any in-map objective.
  • Field Details

    • details

      @Nullable public String details
    • flagsAdded

      public String[] flagsAdded
    • flagsRemoved

      public String[] flagsRemoved
    • markers

    • parents

      public transient Seq<MapObjectives.MapObjective> parents
      The parents of this objective. All parents must be done in order for this to be updated.
    • editorX

      public transient int editorX
      For the objectives UI dialog. Do not modify directly!
    • editorY

      public transient int editorY
      For the objectives UI dialog. Do not modify directly!
  • Constructor Details

    • MapObjective

      public MapObjective()
  • Method Details

    • update

      public abstract boolean update()
      Returns:
      True if this objective is done and should be removed from the executor.
    • reset

      public void reset()
      Reset internal state, if any.
    • done

      public void done()
      Called once after update() returns true, before this objective is removed.
    • changed

      protected void changed()
      Notifies the executor that map rules should be synced.
    • dependencyFinished

      public final boolean dependencyFinished()
      Returns:
      True if all parents are completed, rendering this objective able to execute.
    • isCompleted

      public final boolean isCompleted()
      Returns:
      True if this objective is done (practically, has been removed from the executor).
    • qualified

      public boolean qualified()
      Returns:
      Whether this objective should run at all.
    • child

      Returns:
      This objective, with the given child's parents added with this, for chaining operations.
    • parent

      Returns:
      This objective, with the given parent added to this objective's parents, for chaining operations.
    • details

      public MapObjectives.MapObjective details(String details)
      Returns:
      This objective, with the details message assigned to, for chaining operations.
    • flagsAdded

      public MapObjectives.MapObjective flagsAdded(String... flagsAdded)
      Returns:
      This objective, with the added-flags assigned to, for chaining operations.
    • flagsRemoved

      public MapObjectives.MapObjective flagsRemoved(String... flagsRemoved)
      Returns:
      This objective, with the removed-flags assigned to, for chaining operations.
    • markers

      Returns:
      This objective, with the markers assigned to, for chaining operations.
    • text

      @Nullable public String text()
      Returns:
      Basic mission display text. If null, falls back to standard text.
    • details

      @Nullable public String details()
      Returns:
      Details that appear upon click.
    • typeName

      public String typeName()
      Returns:
      The localized type-name of this objective, defaulting to the class simple name without the "Objective" prefix.