Enum Class CombatPosture

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

public enum CombatPosture extends Enum<CombatPosture>
Whether the bot's force is attacking or defending.

Terrain obstacles - deep water above all - mean opposite things to the two postures, and no single cost tuning produces both behaviors. An attacker treats a river as a cost on the way to the objective: it picks a crossing, pays the risk, and seizes the far bank. A defender treats the same river as its best weapon: it never crosses, holds positions covering the crossing points, and takes the fight to the enemy while the enemy is slowed, split up, and half-disarmed in the water. A bot that prices water one way plays one of those roles well and the other one badly.

AUTO leaves the call to the bot, which reads it from what it already knows each round - whether it has somewhere to go, and whether the enemy is coming to it. See PostureResolver.

  • Enum Constant Details

    • ATTACK

      public static final CombatPosture ATTACK
      Take ground: obstacles are a cost to pay on the way to the enemy.
    • DEFEND

      public static final CombatPosture DEFEND
      Hold ground: obstacles are a weapon, and the enemy should be the one paying to cross them.
    • AUTO

      public static final CombatPosture AUTO
      Let the bot decide each round from its mission and the enemy's movement.
  • Method Details

    • values

      public static CombatPosture[] 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 CombatPosture 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
    • toString

      public String toString()
      Overrides:
      toString in class Enum<CombatPosture>
    • parse

      public static CombatPosture parse(@Nullable String text)
      Parses a posture from text, for XML round-trips and behavior scripts.
      Parameters:
      text - the posture name, case-insensitive
      Returns:
      the matching posture, or AUTO when the text matches nothing