Package mindustry.ai

Class UnitCommand

All Implemented Interfaces:
Comparable<Content>

public class UnitCommand extends MappableContent
Defines a pattern of behavior that an RTS-controlled unit should follow. Shows up in the command UI.
  • Field Details

    • moveCommand

      public static UnitCommand moveCommand
    • repairCommand

      public static UnitCommand repairCommand
    • rebuildCommand

      public static UnitCommand rebuildCommand
    • assistCommand

      public static UnitCommand assistCommand
    • mineCommand

      public static UnitCommand mineCommand
    • boostCommand

      public static UnitCommand boostCommand
    • enterPayloadCommand

      public static UnitCommand enterPayloadCommand
    • loadUnitsCommand

      public static UnitCommand loadUnitsCommand
    • loadBlocksCommand

      public static UnitCommand loadBlocksCommand
    • unloadPayloadCommand

      public static UnitCommand unloadPayloadCommand
    • loopPayloadCommand

      public static UnitCommand loopPayloadCommand
    • icon

      public final String icon
      Name of UI icon (from Icon class).
    • controller

      public final arc.func.Func<mindustry.gen.Unit,AIController> controller
      Controller that this unit will use when this command is used. Return null for "default" behavior.
    • switchToMove

      public boolean switchToMove
      If true, this unit will automatically switch away to the move command when given a position.
    • drawTarget

      public boolean drawTarget
      Whether to draw the movement/attack target.
    • resetTarget

      public boolean resetTarget
      Whether to reset targets when switching to or from this command.
    • exactArrival

      public boolean exactArrival
    • keybind

      @Nullable public Binding keybind
      Key to press for this command.
  • Constructor Details

  • Method Details

    • localized

      public String localized()
    • getIcon

      public arc.scene.style.TextureRegionDrawable getIcon()
    • getEmoji

      public char getEmoji()
    • getContentType

      public ContentType 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 class Content
    • toString

      public String toString()
      Overrides:
      toString in class MappableContent
    • loadAll

      public static void loadAll()