Class ProtoMekUtil

java.lang.Object
megameklab.util.ProtoMekUtil

public final class ProtoMekUtil extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addProtoMekAmmo(megamek.common.units.ProtoMek entity, megamek.common.equipment.EquipmentType ammo, int shots)
    Adds the given number of shots to the already present given ammo on the given ProtoMek.
    static boolean
    isProtoMekEquipment(megamek.common.equipment.EquipmentType eq, megamek.common.units.ProtoMek proto)
     
    static boolean
    isProtoMekEquipment(megamek.common.equipment.EquipmentType eq, megamek.common.units.ProtoMek proto, boolean checkConfiguration)
     
    static boolean
    protoMekHasRoom(megamek.common.units.ProtoMek proto, int location, megamek.common.equipment.Mounted<?> mount)
    Checks whether the space has room for the equipment within the slot and weight limits.
    static void
    reduceProtoMekAmmo(megamek.common.units.ProtoMek entity, megamek.common.equipment.EquipmentType ammo, int shots)
    Subtracts the given number of shots from the given ammo on the given ProtoMek.

    Methods inherited from class java.lang.Object

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

    • isProtoMekEquipment

      public static boolean isProtoMekEquipment(megamek.common.equipment.EquipmentType eq, megamek.common.units.ProtoMek proto)
    • isProtoMekEquipment

      public static boolean isProtoMekEquipment(megamek.common.equipment.EquipmentType eq, megamek.common.units.ProtoMek proto, boolean checkConfiguration)
    • addProtoMekAmmo

      public static void addProtoMekAmmo(megamek.common.units.ProtoMek entity, megamek.common.equipment.EquipmentType ammo, int shots) throws megamek.common.exceptions.LocationFullException
      Adds the given number of shots to the already present given ammo on the given ProtoMek.
      Throws:
      megamek.common.exceptions.LocationFullException
    • reduceProtoMekAmmo

      public static void reduceProtoMekAmmo(megamek.common.units.ProtoMek entity, megamek.common.equipment.EquipmentType ammo, int shots)
      Subtracts the given number of shots from the given ammo on the given ProtoMek. May remove the entire Mounted from the ProtoMek.
    • protoMekHasRoom

      public static boolean protoMekHasRoom(megamek.common.units.ProtoMek proto, int location, megamek.common.equipment.Mounted<?> mount)
      Checks whether the space has room for the equipment within the slot and weight limits.
      Parameters:
      location - A ProtoMek location
      mount - The equipment to be added to the location
      Returns:
      Whether the equipment can be added without exceeding the limits.