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 UnitCommandstatic UnitCommandfinal arc.func.Func<mindustry.gen.Unit,AIController> Controller that this unit will use when this command is used.booleanWhether to draw the movement/attack target.static UnitCommandbooleanfinal StringName of UI icon (from Icon class).arc.input.KeyBindKey to press for this command.static UnitCommandstatic UnitCommandstatic UnitCommandstatic UnitCommandstatic UnitCommandstatic UnitCommandbooleanIf true, this command refreshes the list of stances when selected TODO: do not use, this will likely be removed later!static UnitCommandbooleanWhether to reset targets when switching to or from this command.booleanWhether to snap the command destination to ally buildings.booleanIf true, this unit will automatically switch away to the move command when given a position.static UnitCommandFields 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, arc.input.KeyBind 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. -
snapToBuilding
public boolean snapToBuildingWhether to snap the command destination to ally buildings. -
exactArrival
public boolean exactArrival -
refreshOnSelect
public boolean refreshOnSelectIf true, this command refreshes the list of stances when selected TODO: do not use, this will likely be removed later! -
keybind
@Nullable public arc.input.KeyBind keybindKey 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, arc.input.KeyBind 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:ContentReturns the type name of this piece of content. This should return the same value for all instances of this content type.- Specified by:
getContentTypein classContent
-
toString
- Overrides:
toStringin classMappableContent
-
loadAll
public static void loadAll()
-