Class CompositeTechLevelReport

java.lang.Object
megamek.common.CompositeTechLevelReport

public final class CompositeTechLevelReport extends Object
Builds a breakdown of how a unit's composite tech level is put together: the tech level of every component both with and without the Variable Tech Level rule, and the running composite the components produce as they are folded in.

This answers questions of the form "why is my unit Experimental?", which the final tech level alone cannot.

The breakdown is available as HTML for display and as plain text for copying. Both are rendered from the same collected data, so they always say the same thing.

Since:
0.51.01
  • Method Details

    • toHtml

      public static String toHtml(Entity entity, Faction techFaction, int evaluationYear, boolean useVariableTechLevel)
      Returns the breakdown as an HTML document for display in a themed HTML pane.
      Parameters:
      entity - The unit to break down
      techFaction - The faction to evaluate faction-specific dates for
      evaluationYear - The year to evaluate the variable tech level in
      useVariableTechLevel - true when the Variable Tech Level rule is in use, so that the variable level is reported as the unit's effective tech level
      Returns:
      The breakdown as HTML
    • toPlainText

      public static String toPlainText(Entity entity, Faction techFaction, int evaluationYear, boolean useVariableTechLevel)
      Returns the breakdown as plain text, laid out in aligned columns for copying into a bug report or a forum post.
      Parameters:
      entity - The unit to break down
      techFaction - The faction to evaluate faction-specific dates for
      evaluationYear - The year to evaluate the variable tech level in
      useVariableTechLevel - true when the Variable Tech Level rule is in use, so that the variable level is reported as the unit's effective tech level
      Returns:
      The breakdown as plain text