Record Class AeroDamageApplier

java.lang.Object
java.lang.Record
megamek.common.autoResolve.damage.AeroDamageApplier
Record Components:
entity - Aero entity
entityFinalState - 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.
  • Constructor Details

    • AeroDamageApplier

      public AeroDamageApplier(Aero entity, EntityFinalState entityFinalState)
      Creates an instance of a AeroDamageApplier record class.
      Parameters:
      entity - the value for the entity record component
      entityFinalState - the value for the entityFinalState record component
  • Method Details

    • devastateUnit

      public int devastateUnit()
      Specified by:
      devastateUnit in interface DamageApplier<Aero>
    • getRandomHitLocation

      public int getRandomHitLocation()
      Description copied from interface: DamageApplier
      Returns the location to hit.
      Specified by:
      getRandomHitLocation in interface DamageApplier<Aero>
      Returns:
      returns a valid random location to be hit.
    • damageInternals

      public DamageApplier.HitDetails damageInternals(DamageApplier.HitDetails hitDetails)
      Description copied from interface: DamageApplier
      Applies damage to the internals of the entity.
      Specified by:
      damageInternals in interface DamageApplier<Aero>
      Parameters:
      hitDetails - the hit details
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • entity

      public Aero entity()
      Returns the value of the entity record component.
      Specified by:
      entity in interface DamageApplier<Aero>
      Returns:
      the value of the entity record component
    • entityFinalState

      public EntityFinalState entityFinalState()
      Returns the value of the entityFinalState record component.
      Specified by:
      entityFinalState in interface DamageApplier<Aero>
      Returns:
      the value of the entityFinalState record component