Class WeaponOrderHandler

java.lang.Object
megamek.common.weapons.handlers.WeaponOrderHandler

public class WeaponOrderHandler extends Object
This class loads the custom weapon orders lists from the mmconf/customWeaponOrder.xml files.
  • Field Details

  • Constructor Details

    • WeaponOrderHandler

      public WeaponOrderHandler()
  • Method Details

    • saveWeaponOrderFile

      public static void saveWeaponOrderFile() throws IOException
      Save customWeaponOrderMap to a file.
      Throws:
      IOException
    • getWeaponOrder

      @Nullable public static WeaponOrderHandler.WeaponOrder getWeaponOrder(String chassis, String model)
      Retrieves the custom weapon order Map for the given chassis/model.
      Parameters:
      chassis - The unit's chassis.
      model - The unit's model
      Returns:
      A Map for the custom weapon order for the given unit. If the unit is not in the list, a NULL value is returned.
    • setWeaponOrder

      public static void setWeaponOrder(String chassis, String model, WeaponSortOrder type, Map<Integer,Integer> customWeaponOrder)
      Sets the custom weapon order for the given chassis and model.