Class StandardInventoryEntry

java.lang.Object
megameklab.printing.StandardInventoryEntry
All Implemented Interfaces:
Comparable<StandardInventoryEntry>, InventoryEntry

public class StandardInventoryEntry extends Object implements InventoryEntry, Comparable<StandardInventoryEntry>
Formats text for an entry in the weapons and equipment inventory section of the record sheet. This is for single pieces of equipment. WeaponBays should use WeaponBayInventoryEntry.
  • Constructor Details

    • StandardInventoryEntry

      public StandardInventoryEntry(megamek.common.equipment.Mounted<?> m)
  • Method Details

    • getUniqueId

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

      public megamek.common.equipment.Mounted<?> getMounted()
    • isDamaged

      public boolean isDamaged()
      Specified by:
      isDamaged in interface InventoryEntry
      Returns:
      If is damaged
    • 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
    • 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
    • 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.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(StandardInventoryEntry o)
      Specified by:
      compareTo in interface Comparable<StandardInventoryEntry>
    • incrementQty

      public void incrementQty()
    • 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