Enum Class AIType

java.lang.Object
java.lang.Enum<AIType>
megamek.client.bot.AIType
All Implemented Interfaces:
Serializable, Comparable<AIType>, Constable

public enum AIType extends Enum<AIType>
Identifies which bot AI implementation to construct. Used by BotFactory as the single selection point for building bots, so callers (lobby, scenario loaders, headless runners) no longer hardcode a concrete bot class. Additional AI types (for example a future experimental bot) are added here as their implementations land.
  • Enum Constant Details

    • PRINCESS

      public static final AIType PRINCESS
      The default MegaMek bot, Princess.
    • CASPAR

      public static final AIType CASPAR
      The experimental successor to Princess, Caspar.
  • Method Details

    • values

      public static AIType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AIType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromString

      @Nullable public static AIType fromString(@Nullable String value)
      Parses an AI type from a string (case-insensitive match against the enum name), as used by the scenario ai: key and the /replacePlayer -b: chat argument.
      Parameters:
      value - the string to parse, may be null
      Returns:
      the matching AIType, or null if the value is null or matches no type