Class BotFormationsMenuBuilder

java.lang.Object
megamek.client.ui.dialogs.BotCommands.BotFormationsMenuBuilder

public final class BotFormationsMenuBuilder extends Object
Builds the lobby's formation menu for a bot lance, so the lance starts the game in formation. In game, formations are set in the Move Order editor.

Every member carries the formation in its own orders, with its slot: the leader is slot 0 and the others follow in the lance's order.

  • Method Details

    • lobbyFormationMenu

      public static JMenu lobbyFormationMenu(AbstractClient client, Game game, Force lance, List<Integer> unitIds)
      The lobby's Formation menu for one bot lance, so a lance can start the game already in formation: one item per shape, spacing FormationOrder.DEFAULT_SPACING, the lance's first unit leading and keeping together, plus Formation off. A convoy keeps its Run pace and Push through; any other lance takes the default pace and contact rule (see MoveOrderCommands.lobbyFormationCommands(java.util.List<megamek.common.units.Entity>, megamek.common.orders.FormationShape)). The rest can be changed in game from the Move Order editor.
      Parameters:
      client - the client that sends the orders
      game - the game
      lance - the lance
      unitIds - the lance's units, in lance order
      Returns:
      the menu
    • lobbyParentFormationMenu

      public static JMenu lobbyParentFormationMenu(AbstractClient client, Game game, Force parent, List<List<Integer>> lances)
      The lobby's Formation menu for a bot's parent force, a company with lances under it: the chosen shape, or Formation off, goes to every lance under it, each on its own leader with its own slots and by the same rules as lobbyFormationMenu(megamek.client.AbstractClient, megamek.common.game.Game, megamek.common.force.Force, java.util.List<java.lang.Integer>). Right-clicking the parent force offered no formation at all, and the tester concluded there was none (QA playtest, #9526).
      Parameters:
      client - the client that sends the orders
      game - the game
      parent - the parent force
      lances - the units of each lance under it that take orders, in lance order; lances of fewer than two units are left out
      Returns:
      the menu
    • lobbyParentRoleItem

      public static JMenuItem lobbyParentRoleItem()
      The lobby's Role item for a bot's parent force: disabled, saying to set the role on each lance, since a role is a lance's job and a company holds lances with different ones.
      Returns:
      the item
    • lobbyRoleMenu

      public static JMenu lobbyRoleMenu(AbstractClient client, JFrame frame, Game game, Player owner, Force lance, List<Integer> unitIds)
      The lobby's Role menu for one bot lance, beside Formation: None, Convoy... or Escort..., the last two opening the Role dialog on that choice. Roles are set in the lobby so a convoy and its escorts start the game knowing their jobs (HammerGS, 2026-10-02).
      Parameters:
      client - the client that sends the orders
      frame - the owner of the Role dialog
      game - the game
      owner - the bot that owns the lance
      lance - the lance
      unitIds - the lance's units
      Returns:
      the menu