Record Class IntrinsicPhysicalInventoryEntry

java.lang.Object
java.lang.Record
megameklab.printing.IntrinsicPhysicalInventoryEntry
All Implemented Interfaces:
InventoryEntry

public record IntrinsicPhysicalInventoryEntry(String name, String location, String damage, String mod, boolean optional) extends Record implements InventoryEntry
  • Constructor Details

    • IntrinsicPhysicalInventoryEntry

      public IntrinsicPhysicalInventoryEntry(String name, String location, String damage, String mod, boolean optional)
      Creates an instance of a IntrinsicPhysicalInventoryEntry record class.
      Parameters:
      name - the value for the name record component
      location - the value for the location record component
      damage - the value for the damage record component
      mod - the value for the mod record component
      optional - the value for the optional record component
  • Method Details

    • getEntriesFor

      public static ArrayList<InventoryEntry> getEntriesFor(megamek.common.units.Entity entity)
    • optional

      public boolean optional()
      Returns the value of the optional record component.
      Returns:
      the value of the optional record component
    • nRows

      public int nRows()
      Specified by:
      nRows in interface InventoryEntry
      Returns:
      The number of rows this entry takes on the table. This does not consider text that is wrapped due to insufficient field width.
    • getUniqueId

      public String getUniqueId()
      Specified by:
      getUniqueId in interface InventoryEntry
    • getQuantityField

      public String getQuantityField(int row)
      Specified by:
      getQuantityField in interface InventoryEntry
      Parameters:
      row - The row index within the entry. Should be < nRows()
      Returns:
      The number of identical equipment pieces represented by this entry
    • getNameField

      public String getNameField(int row)
      Specified by:
      getNameField in interface InventoryEntry
      Parameters:
      row - The row index within the entry. Should be < nRows()
      Returns:
      The name of the equipment
    • isDamaged

      public boolean isDamaged()
      Specified by:
      isDamaged in interface InventoryEntry
      Returns:
      If is damaged
    • getLocationField

      public String getLocationField(int row)
      Specified by:
      getLocationField in interface InventoryEntry
      Parameters:
      row - The row index within the entry. Should be < nRows()
      Returns:
      The location/firing arc
    • getHeatField

      public String getHeatField(int row)
      Specified by:
      getHeatField in interface InventoryEntry
      Parameters:
      row - The row index within the entry. Should be < nRows()
      Returns:
      The amount of heat generated
    • getDamageField

      public String getDamageField(int row)
      Specified by:
      getDamageField in interface InventoryEntry
      Parameters:
      row - The row index within the entry. Should be < nRows()
      Returns:
      The damage caused by the weapon, as well as its type code
    • getMinField

      public String getMinField(int row)
      Specified by:
      getMinField in interface InventoryEntry
      Parameters:
      row - The row index within the entry. Should be < nRows()
      Returns:
      The upper limit of the minimum range
    • getShortField

      public String getShortField(int row)
      Specified by:
      getShortField in interface InventoryEntry
      Parameters:
      row - The row index within the entry. Should be < nRows()
      Returns:
      The upper limit of the short range (ground units) or SRV (aero units)
    • getMediumField

      public String getMediumField(int row)
      Specified by:
      getMediumField in interface InventoryEntry
      Parameters:
      row - The row index within the entry. Should be < nRows()
      Returns:
      The upper limit of the medium range (ground units) or MRV (aero units)
    • getLongField

      public String getLongField(int row)
      Specified by:
      getLongField in interface InventoryEntry
      Parameters:
      row - The row index within the entry. Should be < nRows()
      Returns:
      The upper limit of the long range (ground units) or LRV (aero units)
    • getExtremeField

      public String getExtremeField(int row)
      Specified by:
      getExtremeField in interface InventoryEntry
      Parameters:
      row - The row index within the entry. Should be < nRows()
      Returns:
      The ERV (aero units)
    • getModField

      public String getModField(int row, boolean baseOnly)
      Specified by:
      getModField in interface InventoryEntry
      Parameters:
      row - The row index within the entry
      Returns:
      The to-hit modifier of the item
    • indentMultiline

      public boolean indentMultiline()
      Specified by:
      indentMultiline in interface InventoryEntry
      Returns:
      Whether lines after the first line should be indented
    • hasQuirks

      public boolean hasQuirks()
      Specified by:
      hasQuirks in interface InventoryEntry
      Returns:
      Whether the entry has any quirks that need to be printed
    • getQuirksField

      public String getQuirksField()
      Specified by:
      getQuirksField in interface InventoryEntry
      Returns:
      The quirk text to print, if any
    • 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. 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.
    • name

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

      public String location()
      Returns the value of the location record component.
      Returns:
      the value of the location record component
    • damage

      public String damage()
      Returns the value of the damage record component.
      Returns:
      the value of the damage record component
    • mod

      public String mod()
      Returns the value of the mod record component.
      Returns:
      the value of the mod record component