Class AeroTROView

java.lang.Object
megamek.common.templates.TROView
megamek.common.templates.AeroTROView
Direct Known Subclasses:
CapitalShipTROView, SmallCraftDropshipTROView

public class AeroTROView extends TROView
Creates a TRO template model for aerospace and conventional fighters.
  • Constructor Details

    • AeroTROView

      public AeroTROView(Aero aero)
  • Method Details

    • getTemplateFileName

      protected String getTemplateFileName(boolean html)
      Overrides:
      getTemplateFileName in class TROView
    • initModel

      protected void initModel(EntityVerifier verifier)
      Overrides:
      initModel in class TROView
    • addWeaponBays

      protected int addWeaponBays(String[][] arcSets)
      Adds the details for all weapon bays, including heat by bay and location and rows for each bay.
      Parameters:
      arcSets - A two-dimensional array that groups arcs that should appear on the same line (e.g. left/right). Only the first arc in any group is actually evaluated, since the rules require left/right arcs be identical, but both arcs are combined in the name.
      Returns:
      The width of the longest value for bay/weapon name, for use in laying out plain text.
    • getArcAbbr

      protected String getArcAbbr(Mounted<?> m)
      Firing arc abbreviation, which may be different from mounting location for side arcs on small craft and dropships
      Parameters:
      m - The weapon mount
      Returns:
      The arc abbreviation.
    • addAmmo

      protected void addAmmo()
      Adds ammo data used by large craft
    • addCrewEntry

      protected void addCrewEntry(String stringKey, int count)
      Convenience method to add the number of crew in a category to a list, and choose the singular or plural form. The localized string property should be provided for both singular and plural entries, even if they are the same (such as enlisted/non-rated and bay personnel in English).

      The model needs to have a "crew" entry initialized to a List<String> before calling this method.

      Parameters:
      stringKey - The key for the string property in the singular form. A "TROView." prefix will be added, and if the plural form is needed "s" will be appended.
      count - The number of crew in the category
      Throws:
      NullPointerException - If the "crew" property in the model has not been initialized
      ClassCastException - If the crew property of the model is not a List<String>
    • skipMount

      protected boolean skipMount(Mounted<?> mount, boolean includeAmmo)
      Description copied from class: TROView
      Test for whether the mount should be included in the equipment inventory section.
      Overrides:
      skipMount in class TROView
      Parameters:
      mount - The equipment mount
      includeAmmo - Whether to include ammo in the list
      Returns:
      Whether to list the equipment in the inventory section