Class AeroUtil

java.lang.Object
megameklab.util.AeroUtil

public final class AeroUtil extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    assignQuarters(megamek.common.units.Aero aero, int officer, int standard, int secondClass, int steerage)
    Adjusts the number of all types of crew quarters on an aerospace vessel.
    static void
    autoAssignQuarters(megamek.common.units.Aero aero)
    Adjusts the number of quarters of each to match the crew and passenger needs.
    static boolean
    isAeroEquipment(megamek.common.equipment.EquipmentType eq, megamek.common.units.Aero unit)
     
    static boolean
    isAeroWeapon(megamek.common.equipment.EquipmentType eq, megamek.common.units.Aero unit)
     
    static void
    moveOrAddEquipmentOnFighter(megamek.common.units.AeroSpaceFighter aero, megamek.common.equipment.Mounted<?> mounted, int location)
     
    static void
    removeAllCriticalSlotsFromFighter(megamek.common.units.AeroSpaceFighter aero)
    Removes all critical slots for the given fighter, unallocating all equipment (i.e., placing it into Entity.LOC_NONE) with the exception of certain equipment that has a fixed location such as Ammo.
    static void
    removeClanCASE(megamek.common.units.AeroSpaceFighter aero)
     
    static void
    setQuarters(megamek.common.units.Aero aero, megamek.common.verifier.TestAero.Quarters quarters, int size)
    Adjusts the number of crew quarters of a given type on an aerospace vessel.
    static void
    updateLoadedAero(megamek.common.units.Aero unit)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isAeroWeapon

      public static boolean isAeroWeapon(megamek.common.equipment.EquipmentType eq, megamek.common.units.Aero unit)
    • isAeroEquipment

      public static boolean isAeroEquipment(megamek.common.equipment.EquipmentType eq, megamek.common.units.Aero unit)
    • setQuarters

      public static void setQuarters(megamek.common.units.Aero aero, megamek.common.verifier.TestAero.Quarters quarters, int size)
      Adjusts the number of crew quarters of a given type on an aerospace vessel.
      Parameters:
      aero - The aerospace unit to change crew quarters sizes for
      quarters - The type of crew quarters to change
      size - The number of personnel that can be housed in the designated type of quarters
    • assignQuarters

      public static void assignQuarters(megamek.common.units.Aero aero, int officer, int standard, int secondClass, int steerage)
      Adjusts the number of all types of crew quarters on an aerospace vessel.
      Parameters:
      aero - The vessel
      officer - The number of officer/first class quarters
      standard - The number of standard crew quarters
      secondClass - The number second class passenger quarters
      steerage - The number of steerage class crew/passenger quarters
    • autoAssignQuarters

      public static void autoAssignQuarters(megamek.common.units.Aero aero)
      Adjusts the number of quarters of each to match the crew and passenger needs. If no quarters are already assigned, this will put all officers in officer/first class cabins, enlisted crew in standard crew quarters, and passengers in second class cabins. If there are already more officer/first class cabins assigned than there are officers, the extra will be used as first class passenger cabins. Any steerage quarters will be assigned first to marines, then to passengers, then to remaining enlisted.
      Parameters:
      aero - The vessel to assign quarters for.
    • updateLoadedAero

      public static void updateLoadedAero(megamek.common.units.Aero unit)
    • moveOrAddEquipmentOnFighter

      public static void moveOrAddEquipmentOnFighter(megamek.common.units.AeroSpaceFighter aero, megamek.common.equipment.Mounted<?> mounted, int location) throws megamek.common.exceptions.LocationFullException
      Throws:
      megamek.common.exceptions.LocationFullException
    • removeClanCASE

      public static void removeClanCASE(megamek.common.units.AeroSpaceFighter aero)
    • removeAllCriticalSlotsFromFighter

      public static void removeAllCriticalSlotsFromFighter(megamek.common.units.AeroSpaceFighter aero)
      Removes all critical slots for the given fighter, unallocating all equipment (i.e., placing it into Entity.LOC_NONE) with the exception of certain equipment that has a fixed location such as Ammo.