Package mindustry.ai
Class UnitCommand
java.lang.Object
mindustry.ai.UnitCommand
Defines a pattern of behavior that an RTS-controlled unit should follow. Shows up in the command UI.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Seq<UnitCommand>
List of all commands by ID.static final UnitCommand
static final UnitCommand
final Func<mindustry.gen.Unit,
AIController> Controller that this unit will use when this command is used.boolean
Whether to draw the movement/attack target.final String
Name of UI icon (from Icon class).final int
Unique ID number.static final UnitCommand
static final UnitCommand
final String
Named used for tooltip/description.static final UnitCommand
static final UnitCommand
boolean
Whether to reset targets when switching to or from this command.boolean
If true, this unit will automatically switch away to the move command when given a position. -
Constructor Summary
ConstructorDescriptionUnitCommand
(String name, String icon, Func<mindustry.gen.Unit, AIController> controller) -
Method Summary
-
Field Details
-
all
List of all commands by ID. -
moveCommand
-
repairCommand
-
rebuildCommand
-
assistCommand
-
mineCommand
-
boostCommand
-
id
public final int idUnique ID number. -
name
Named used for tooltip/description. -
icon
Name of UI icon (from Icon class). -
controller
Controller that this unit will use when this command is used. Return null for "default" behavior. -
switchToMove
public boolean switchToMoveIf true, this unit will automatically switch away to the move command when given a position. -
drawTarget
public boolean drawTargetWhether to draw the movement/attack target. -
resetTarget
public boolean resetTargetWhether to reset targets when switching to or from this command.
-
-
Constructor Details
-
UnitCommand
-
-
Method Details