Package mindustry.ai
Class UnitCommand
java.lang.Object
mindustry.ctype.Content
mindustry.ctype.MappableContent
mindustry.ai.UnitCommand
- All Implemented Interfaces:
Comparable<Content>
Defines a pattern of behavior that an RTS-controlled unit should follow. Shows up in the command UI.
-
Nested Class Summary
Nested classes/interfaces inherited from class mindustry.ctype.Content
Content.ModContentInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic UnitCommand
static UnitCommand
final arc.func.Func<mindustry.gen.Unit,
AIController> Controller that this unit will use when this command is used.boolean
Whether to draw the movement/attack target.static UnitCommand
boolean
final String
Name of UI icon (from Icon class).Key to press for this command.static UnitCommand
static UnitCommand
static UnitCommand
static UnitCommand
static UnitCommand
static UnitCommand
static 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.static UnitCommand
Fields inherited from class mindustry.ctype.MappableContent
name
-
Constructor Summary
ConstructorsConstructorDescriptionUnitCommand
(String name, String icon, arc.func.Func<mindustry.gen.Unit, AIController> controller) UnitCommand
(String name, String icon, Binding keybind, arc.func.Func<mindustry.gen.Unit, AIController> controller) -
Method Summary
-
Field Details
-
moveCommand
-
repairCommand
-
rebuildCommand
-
assistCommand
-
mineCommand
-
boostCommand
-
enterPayloadCommand
-
loadUnitsCommand
-
loadBlocksCommand
-
unloadPayloadCommand
-
loopPayloadCommand
-
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. -
exactArrival
public boolean exactArrival -
keybind
Key to press for this command.
-
-
Constructor Details
-
UnitCommand
public UnitCommand(String name, String icon, arc.func.Func<mindustry.gen.Unit, AIController> controller) -
UnitCommand
public UnitCommand(String name, String icon, Binding keybind, arc.func.Func<mindustry.gen.Unit, AIController> controller)
-
-
Method Details
-
localized
-
getIcon
public arc.scene.style.TextureRegionDrawable getIcon() -
getEmoji
public char getEmoji() -
getContentType
Description copied from class:Content
Returns the type name of this piece of content. This should return the same value for all instances of this content type.- Specified by:
getContentType
in classContent
-
toString
- Overrides:
toString
in classMappableContent
-
loadAll
public static void loadAll()
-