Record Class InfantryMount

java.lang.Object
java.lang.Record
megamek.common.units.InfantryMount
All Implemented Interfaces:
Serializable

public record InfantryMount(String name, InfantryMount.BeastSize size, double weight, int movementPoints, EntityMovementMode movementMode, int burstDamage, int vehicleDamage, double damageDivisor, int maxWaterDepth, int secondaryGroundMP, int uwEndurance, boolean custom) extends Record implements Serializable
Stats for beast mounted infantry units. See TO:AU&E, p. 106
See Also:
  • Field Details

  • Constructor Details

    • InfantryMount

      public InfantryMount(String name, InfantryMount.BeastSize size, double weight, int movementPoints, EntityMovementMode movementMode, int burstDamage, int vehicleDamage, double damageDivisor, int maxWaterDepth, int secondaryGroundMP, int uwEndurance)
    • InfantryMount

      public InfantryMount(String name, InfantryMount.BeastSize size, double weight, int movementPoints, EntityMovementMode movementMode, int burstDamage, int vehicleDamage, double damageDivisor, int maxWaterDepth, int secondaryGroundMP, int uwEndurance, boolean custom)
      Creates an instance of a InfantryMount record class.
      Parameters:
      name - the value for the name record component
      size - the value for the size record component
      weight - the value for the weight record component
      movementPoints - the value for the movementPoints record component
      movementMode - the value for the movementMode record component
      burstDamage - the value for the burstDamage record component
      vehicleDamage - the value for the vehicleDamage record component
      damageDivisor - the value for the damageDivisor record component
      maxWaterDepth - the value for the maxWaterDepth record component
      secondaryGroundMP - the value for the secondaryGroundMP record component
      uwEndurance - the value for the uwEndurance record component
      custom - the value for the custom record component
  • Method Details

    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • size

      public InfantryMount.BeastSize size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • weight

      public double weight()
      Returns the value of the weight record component.
      Returns:
      the value of the weight record component
    • getMP

      public int getMP()
      Returns:
      The number of movement points using the primary movement node.
    • movementMode

      public EntityMovementMode movementMode()
      Returns the value of the movementMode record component.
      Returns:
      the value of the movementMode record component
    • getBurstDamageDice

      public int getBurstDamageDice()
      Returns:
      The number of damage dice to use as burst damage against conventional infantry in the same hex.
    • vehicleDamage

      public int vehicleDamage()
      Returns the value of the vehicleDamage record component.
      Returns:
      the value of the vehicleDamage record component
    • damageDivisor

      public double damageDivisor()
      Returns the value of the damageDivisor record component.
      Returns:
      the value of the damageDivisor record component
    • maxWaterDepth

      public int maxWaterDepth()
      Returns the value of the maxWaterDepth record component.
      Returns:
      the value of the maxWaterDepth record component
    • secondaryGroundMP

      public int secondaryGroundMP()
      Returns the value of the secondaryGroundMP record component.
      Returns:
      the value of the secondaryGroundMP record component
    • getUWEndurance

      public int getUWEndurance()
      Returns:
      For creatures with underwater movement, this is the number of turns they can stay underwater before needing to resurface.
    • toString

      @Nonnull public 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
    • parse

      public static InfantryMount parse(String str)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • movementPoints

      public int movementPoints()
      Returns the value of the movementPoints record component.
      Returns:
      the value of the movementPoints record component
    • burstDamage

      public int burstDamage()
      Returns the value of the burstDamage record component.
      Returns:
      the value of the burstDamage record component
    • uwEndurance

      public int uwEndurance()
      Returns the value of the uwEndurance record component.
      Returns:
      the value of the uwEndurance record component
    • custom

      public boolean custom()
      Returns the value of the custom record component.
      Returns:
      the value of the custom record component