Record Class AeroDamageApplier
java.lang.Object
java.lang.Record
megamek.common.autoResolve.damage.AeroDamageApplier
- Record Components:
entity- Aero entityentityFinalState- The final state of the entity
- All Implemented Interfaces:
DamageApplier<Aero>
public record AeroDamageApplier(Aero entity, EntityFinalState entityFinalState)
extends Record
implements DamageApplier<Aero>
Applies damage to an Aero entity.
-
Nested Class Summary
Nested classes/interfaces inherited from interface megamek.common.autoResolve.damage.DamageApplier
DamageApplier.HitDetails -
Field Summary
Fields inherited from interface megamek.common.autoResolve.damage.DamageApplier
logger -
Constructor Summary
ConstructorsConstructorDescriptionAeroDamageApplier(Aero entity, EntityFinalState entityFinalState) Creates an instance of aAeroDamageApplierrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondamageInternals(DamageApplier.HitDetails hitDetails) Applies damage to the internals of the entity.intentity()Returns the value of theentityrecord component.Returns the value of theentityFinalStaterecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the location to hit.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.common.autoResolve.damage.DamageApplier
applyDamage, applyDamage, applyDamageInClusters, applyDamageInClusters, applyDamageToEquipments, crewMayDie, crewMustSurvive, damageArmor, destroyLocation, destroyLocation, entityMustBeDevastated, entityMustSurvive, getHitData, noCrewDamage, setupHitDetails, tryToDamageCrew, tryToDamageCrew
-
Constructor Details
-
AeroDamageApplier
Creates an instance of aAeroDamageApplierrecord class.- Parameters:
entity- the value for theentityrecord componententityFinalState- the value for theentityFinalStaterecord component
-
-
Method Details
-
devastateUnit
public int devastateUnit()- Specified by:
devastateUnitin interfaceDamageApplier<Aero>
-
getRandomHitLocation
public int getRandomHitLocation()Description copied from interface:DamageApplierReturns the location to hit.- Specified by:
getRandomHitLocationin interfaceDamageApplier<Aero>- Returns:
- returns a valid random location to be hit.
-
damageInternals
Description copied from interface:DamageApplierApplies damage to the internals of the entity.- Specified by:
damageInternalsin interfaceDamageApplier<Aero>- Parameters:
hitDetails- the hit details
-
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). -
entity
Returns the value of theentityrecord component.- Specified by:
entityin interfaceDamageApplier<Aero>- Returns:
- the value of the
entityrecord component
-
entityFinalState
Returns the value of theentityFinalStaterecord component.- Specified by:
entityFinalStatein interfaceDamageApplier<Aero>- Returns:
- the value of the
entityFinalStaterecord component
-