Class FormationIconBuilder
FormationLevel
the engine can produce — not just the lance / company pair the legacy AbstractCompanyGenerator
supported.
For each non-leaf Formation, the icon stacks three layers:
- TYPE — a weight-class-based 'Mek silhouette computed from the units in the formation's subtree (Light / Medium / Heavy / Assault / Super-Heavy).
- FORMATION — a shape file matching the formation's
FormationLeveland faction family (IS / Clan / ComStar). All echelons from Team / Point / Level I up through Brigade / Galaxy / Level VI are covered. - BACKGROUND — the faction's standard background, when defined.
The campaign root Formation additionally gets a LOGO layer (or a generic-'Mek TYPE fallback)
driven by CommandGenerationOptions.isUseOriginNodeFormationIconLogo().
This is the spiritual replacement for AbstractCompanyGenerator.createLayeredFormationIcon
scaled up to the full FormationLevel space.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyIcons(Formation root, Campaign campaign, CommandGenerationOptions options) Walks the campaign's Formation tree rooted atrootand applies a layered icon to every non-leaf Formation.static intapplyIconsToFormations(List<Formation> formations, Campaign campaign) Decorates the named formations and everything under them, using the campaign's own faction.static intapplyIconsToSubtree(Formation root, Campaign campaign) Decorates one existing formation and everything under it, using the campaign's own faction.
-
Method Details
-
applyIcons
Walks the campaign's Formation tree rooted atrootand applies a layered icon to every non-leaf Formation. Honors the icon-related toggles onCommandGenerationOptions: ifisGenerateFormationIcons()is off, returns immediately.- Parameters:
root- the campaign's top-level Formation (typicallycampaign.getPlayerForce().getFormations())campaign- the campaign whose units feed the weight-class mathoptions- the options driving icon-generation toggles
-
applyIconsToSubtree
Decorates one existing formation and everything under it, using the campaign's own faction.The generation pass above needs
CommandGenerationOptionsbecause it also decides the origin node's icon. Support teams organized after generation - a campaign that switched the option on - have no generation options to consult, but their formations should look like the generated ones, so this is the same builder without the origin-node question.- Parameters:
root- the formation to decorate, along with its subtreecampaign- the campaign the formation belongs to- Returns:
- the number of formations decorated
-
applyIconsToFormations
Decorates the named formations and everything under them, using the campaign's own faction.Used by the support-team conversion, which knows exactly which formations it created and must not touch the player's own - their icons are their business.
- Parameters:
formations- the formations to decorate, each along with its subtreecampaign- the campaign the formations belong to- Returns:
- the number of formations decorated
-