Package mekhq.campaign.unit.actions
Record Class UnloadAmmoTypeAction
java.lang.Object
java.lang.Record
mekhq.campaign.unit.actions.UnloadAmmoTypeAction
- All Implemented Interfaces:
IUnitAction
Unloads the
AmmoType for an AmmoBin on a Unit, it will not change the AmmoType.-
Constructor Summary
ConstructorsConstructorDescriptionUnloadAmmoTypeAction(AmmoBin ammoBin) Initializes a new instance of theUnloadAmmoTypeActionclass. -
Method Summary
Modifier and TypeMethodDescriptionammoBin()Returns the value of theammoBinrecord component.final booleanIndicates whether some other object is "equal to" this one.voidExecutes an action against a unit in a campaign.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UnloadAmmoTypeAction
Initializes a new instance of theUnloadAmmoTypeActionclass.- Parameters:
ammoBin- TheAmmoBinto unload.
-
-
Method Details
-
execute
Description copied from interface:IUnitActionExecutes an action against a unit in a campaign. The action may have side effects.- Specified by:
executein interfaceIUnitAction- Parameters:
campaign- The campaign object this action is executed against.unit- The unit object this action is executed against.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
ammoBin
Returns the value of theammoBinrecord component.- Returns:
- the value of the
ammoBinrecord component
-