Package megameklab.util
Class ProtoMekUtil
java.lang.Object
megameklab.util.ProtoMekUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddProtoMekAmmo(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 booleanisProtoMekEquipment(megamek.common.equipment.EquipmentType eq, megamek.common.units.ProtoMek proto) static booleanisProtoMekEquipment(megamek.common.equipment.EquipmentType eq, megamek.common.units.ProtoMek proto, boolean checkConfiguration) static booleanprotoMekHasRoom(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 voidreduceProtoMekAmmo(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.
-
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 locationmount- The equipment to be added to the location- Returns:
- Whether the equipment can be added without exceeding the limits.
-