Package mindustry.game
Class MapObjectives
java.lang.Object
mindustry.game.MapObjectives
- All Implemented Interfaces:
Eachable<MapObjectives.MapObjective>
,Iterable<MapObjectives.MapObjective>
public class MapObjectives
extends Object
implements Iterable<MapObjectives.MapObjective>, Eachable<MapObjectives.MapObjective>
Handles and executes in-map objectives.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Build a certain amount of a block.static class
Command any unit to do anything.static class
Get a certain item in your core (through a block, not manually.)static class
static class
static class
Destroy all enemy core(s).static class
Produce a certain amount of units.static class
Wait until a logic flag is set.static class
Have a certain amount of item in your core.static @interface
Forbyte
; treats it as a world label flag.static class
Base abstract class for any in-map objective.static class
Displays a circle on the minimap.static @interface
ForString
; indicates that a text area should be used.static class
Marker used for drawing UI to indicate something along with an objective.static class
Produce a specific piece of content in the tech tree (essentially research with different text).static @interface
ForUnlockableContent
; filters all un-researchable content.static class
Research a specific piece of content in the tech tree.static @interface
Forfloat
; multiplies the UI input by 60.static class
Displays a shape with an outline and color.static class
Displays text above a shape.static @interface
ForBlock
; filters all un-buildable blocks.static class
Displays text at a location.static @interface
static class
static class
Produce a certain amount of a unit.static @interface
For arrays orSeq
s; does not create element rearrangement buttons. -
Field Summary
Modifier and TypeFieldDescriptionAll objectives the executor contains.static final Seq<Prov<? extends MapObjectives.ObjectiveMarker>>
static final Seq<Prov<? extends MapObjectives.MapObjective>>
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(MapObjectives.MapObjective... objectives) Adds all given objectives to the executor as root objectives.boolean
any()
boolean
void
clear()
void
each
(Cons<? super MapObjectives.MapObjective> cons) <T extends MapObjectives.MapObjective>
voideachRunning
(Boolf<? super MapObjectives.MapObjective> pred, Cons<T> cons) Iterates over all qualified in-map objectives, with a filter.void
Iterates over all qualified in-map objectives.iterator()
static void
registerMarker
(Prov<? extends MapObjectives.ObjectiveMarker>... providers) static void
registerObjective
(Prov<? extends MapObjectives.MapObjective>... providers) void
update()
Updates all objectives this executor contains.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
allObjectiveTypes
-
allMarkerTypes
-
all
All objectives the executor contains. Do not modify directly, ever!- See Also:
-
changed
protected transient boolean changed- See Also:
-
-
Constructor Details
-
MapObjectives
public MapObjectives()
-
-
Method Details
-
registerObjective
@SafeVarargs public static void registerObjective(Prov<? extends MapObjectives.MapObjective>... providers) -
registerMarker
@SafeVarargs public static void registerMarker(Prov<? extends MapObjectives.ObjectiveMarker>... providers) -
add
Adds all given objectives to the executor as root objectives. -
update
public void update()Updates all objectives this executor contains. -
checkChanged
public boolean checkChanged()- Returns:
- True if map rules should be synced. Reserved for
Vars.logic
; do not invoke directly!
-
any
public boolean any()- Returns:
- Whether there are any qualified objectives at all.
-
clear
public void clear() -
eachRunning
Iterates over all qualified in-map objectives. -
eachRunning
public <T extends MapObjectives.MapObjective> void eachRunning(Boolf<? super MapObjectives.MapObjective> pred, Cons<T> cons) Iterates over all qualified in-map objectives, with a filter. -
iterator
- Specified by:
iterator
in interfaceIterable<MapObjectives.MapObjective>
-
each
- Specified by:
each
in interfaceEachable<MapObjectives.MapObjective>
-