Package megameklab.ui.listeners
Interface ArmorAllocationListener
- All Known Implementing Classes:
ASStructureTab
,BAStructureTab
,BMStructureTab
,CVStructureTab
,DSStructureTab
,PMStructureTab
,SVArmorTab
,WSStructureTab
public interface ArmorAllocationListener
Listener for changes to armor. No method is required by all implementing classes so all are given a default
noop implementation.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
armorBARRatingChanged
(int bar) Notifies of a change in the BAR of support vehicle armor.default void
armorFactorChanged
(int points) Notifies of a change in the total number of armor points on the unit.default void
armorPointsChanged
(int location, int front, int rear) Notifies of a change to the number of armor points assigned to a particular locationdefault void
armorTechRatingChanged
(int techRating) Notifies of a change in the tech rating of support vehicle armor.default void
armorTonnageChanged
(double tonnage) Notifies of a change in armor tonnage.default void
armorTypeChanged
(int at, int armorTechLevel) Notifies of a change in the armor typedefault void
armorTypeChanged
(megamek.common.equipment.ArmorType armor) Notifies of a change in the armor type.default void
Signals that the armor should be automatically distributed to the various locations.default void
Signals that the armor should be set to the maximum value for the unit.default void
patchworkChanged
(int location, megamek.common.equipment.ArmorType armor) Notifies of a change in the type of armor assigned to a specific location of a unit with patchwork armor.default void
Signals that any remaining weight that has not been allocated should be used for armor, up to the armor limit for the unit.
-
Method Details
-
armorTypeChanged
default void armorTypeChanged(int at, int armorTechLevel) Notifies of a change in the armor type- Parameters:
at
- The armor type constant fromEquipmentType
armorTechLevel
- The tech level constant fromTechConstants
, used to distinguish between IS and Clan versions
-
armorTypeChanged
default void armorTypeChanged(megamek.common.equipment.ArmorType armor) Notifies of a change in the armor type.- Parameters:
armor
- The equipment instance of the armor to use.
-
armorTechRatingChanged
default void armorTechRatingChanged(int techRating) Notifies of a change in the tech rating of support vehicle armor.- Parameters:
techRating
- The new tech rating, using the rating constants fromITechnology
.
-
armorBARRatingChanged
default void armorBARRatingChanged(int bar) Notifies of a change in the BAR of support vehicle armor.- Parameters:
bar
- The new BAR
-
armorTonnageChanged
default void armorTonnageChanged(double tonnage) Notifies of a change in armor tonnage. This is not used by units that assign armor by point.- Parameters:
tonnage
- The total weight of armor on the unit.
-
maximizeArmor
default void maximizeArmor()Signals that the armor should be set to the maximum value for the unit. -
useRemainingTonnageArmor
default void useRemainingTonnageArmor()Signals that any remaining weight that has not been allocated should be used for armor, up to the armor limit for the unit. -
armorFactorChanged
default void armorFactorChanged(int points) Notifies of a change in the total number of armor points on the unit. This is used for unit types that assign armor by the point rather than by weight.- Parameters:
points
- The total number of armor points on the unit.
-
armorPointsChanged
default void armorPointsChanged(int location, int front, int rear) Notifies of a change to the number of armor points assigned to a particular location- Parameters:
location
- The location to assign the pointsfront
- The number of points to assign to the front (or total to the location if there is not separate rear armor)rear
- The number of points to assign to the rear armor of the location
-
patchworkChanged
default void patchworkChanged(int location, megamek.common.equipment.ArmorType armor) Notifies of a change in the type of armor assigned to a specific location of a unit with patchwork armor.- Parameters:
location
- The location constantarmor
- The type of armor used in the location.
-
autoAllocateArmor
default void autoAllocateArmor()Signals that the armor should be automatically distributed to the various locations.
-