Package mindustry.game
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
Base abstract class for any in-map objective.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
changed()
Notifies the executor that map rules should be synced.child
(MapObjectives.MapObjective child) final boolean
details()
void
done()
Called once afterupdate()
returns true, before this objective is removed.flagsAdded
(String... flagsAdded) flagsRemoved
(String... flagsRemoved) final boolean
markers
(MapObjectives.ObjectiveMarker... markers) parent
(MapObjectives.MapObjective parent) boolean
void
reset()
Reset internal state, if any.text()
typeName()
abstract boolean
update()
-
Field Details
-
details
-
flagsAdded
-
flagsRemoved
-
markers
-
parents
The parents of this objective. All parents must be done in order for this to be updated. -
editorX
public transient int editorXFor the objectives UI dialog. Do not modify directly! -
editorY
public transient int editorYFor 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 afterupdate()
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
- Returns:
- This objective, with the details message assigned to, for chaining operations.
-
flagsAdded
- Returns:
- This objective, with the added-flags assigned to, for chaining operations.
-
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
- Returns:
- Basic mission display text. If null, falls back to standard text.
-
details
- Returns:
- Details that appear upon click.
-
typeName
- Returns:
- The localized type-name of this objective, defaulting to the class simple name without the "Objective" prefix.
-