Package megamek.client.ui.entityreadout
Interface EntityReadout
public interface EntityReadout
The Entity information shown in the unit selector and many other places in MM, MML and MHQ.
The information is encoded in a series of classes that implement a common ViewElement interface, which
can format the element in any of the available output formats.
Goals for the Entity Readout:
- Should be adaptable to various output formats, currently HTML, plain text and discord, on-the-fly rather than fixed at construction
- Should show information sufficient to recreate the unit in MML (while undamaged)
- Should highlight damaged and destroyed items and critical hits as well as current values (movement)
- Should show current ammo values
- Need not show construction details without gameplay effects such as the maximum armor the unit type could carry or the slot number of an item on a mek
- Should show derived stats when they are difficult or tedious to get (total armor, cost, BV etc.)
- Need not show original values for damaged items unless those are relevant for gameplay
- Should be organized into blocks that can be retrieved individually
- Heat sink locations are not displayed
- Output formatting is given at construction time, although most elements can output for any formatting on the fly. This should be changed to always take a formatting parameter when obtaining the readout result.
-
Method Summary
Modifier and TypeMethodDescriptionstatic EntityReadoutcreateReadout(Entity entity, boolean showDetail) Compiles information about anEntityuseful for showing a summary of its abilities.static EntityReadoutcreateReadout(Entity entity, boolean showDetail, boolean useAlternateCost) Compiles information about anEntityuseful for showing a summary of its abilities.static EntityReadoutcreateReadout(Entity entity, boolean showDetail, boolean useAlternateCost, boolean ignorePilotBV) Compiles information about anEntityuseful for showing a summary of its abilities.getBasicSection(ViewFormatting formatting) default StringgetFullReadout(String fontName, ViewFormatting formatting) default StringgetFullReadout(ViewFormatting formatting) getLoadoutSection(ViewFormatting formatting) getReadout(String fontName, ViewFormatting formatting, Collection<ReadoutSections> sectionsToShow)
-
Method Details
-
createReadout
Compiles information about anEntityuseful for showing a summary of its abilities. Produced output formatted in html.- Parameters:
entity- The entity to summarizeshowDetail- If true, shows individual weapons that make up weapon bays.
-
createReadout
Compiles information about anEntityuseful for showing a summary of its abilities. Produced output formatted in html.- Parameters:
entity- The entity to summarizeshowDetail- If true, shows individual weapons that make up weapon bays.useAlternateCost- If true, uses alternate cost calculation. This primarily provides an equipment-only cost for conventional infantry for MekHQ.
-
createReadout
static EntityReadout createReadout(Entity entity, boolean showDetail, boolean useAlternateCost, boolean ignorePilotBV) Compiles information about anEntityuseful for showing a summary of its abilities.- Parameters:
entity- The entity to summarizeshowDetail- If true, shows individual weapons that make up weapon bays.useAlternateCost- If true, uses alternate cost calculation. This primarily provides an equipment-only cost for conventional infantry for MekHQ.ignorePilotBV- If true then the BV calculation is done without including the pilot BV modifiers
-
getBasicSection
- Returns:
- The formatted basic values section, including movement, system equipment (cockpit, gyro, etc.) and armor.
-
getLoadoutSection
- Returns:
- The formatted loadout section, including weapons, ammo, and other equipment.
-
getFullReadout
- Returns:
- The formatted readout with all sections (including fluff texts, if present), using HTML output formatting.
-
getFullReadout
- Returns:
- The formatted readout with all sections (including fluff texts, if present), using the given output formatting
-
getFullReadout
- Returns:
- The formatted readout with all sections (including fluff texts, if present), using the given font if applicable and using the given output formatting.
-
getReadout
String getReadout(String fontName, ViewFormatting formatting, Collection<ReadoutSections> sectionsToShow) - Returns:
- The formatted readout including only the given sections, using the given font if applicable and using the given output formatting.
-