Class FormationNamingConvention

java.lang.Object
megamek.client.ratgenerator.FormationNamingConvention

public class FormationNamingConvention extends Object
How one faction designates its formations, read from the <formationNaming> element of a faction ruleset file.

The ruleset <name> elements already produce faction-correct flavour names - "Battle Lance", "Assault Cluster", "Trinary [Battle]", "IV-alpha". What they cannot express is how a consumer should designate those formations relative to one another: whether the companies of a battalion are lettered and restart in each battalion, whether regiments take ordinals, or whether a Clan galaxy takes a Greek letter. That positional vocabulary differs sharply between the Inner Sphere, the Clans and ComStar, and this element is where each tradition declares it.

Conventions are authored in the four root rulesets (IS, CLAN, CS, Periphery) and inherited by every other faction through Ruleset.findNamingTier(int), which walks the parent chain one echelon at a time. A faction therefore overrides a single echelon without restating the whole convention.

Echelon numbers are not unique across traditions - echelon 4 is an Inner Sphere Company, a Clan Binary and a ComStar Choir. That is unambiguous here because a convention is only ever consulted through the ruleset of the faction it belongs to.

See Also:
  • Constructor Details

    • FormationNamingConvention

      public FormationNamingConvention()
  • Method Details

    • getTier

      @Nullable public FormationNamingConvention.Tier getTier(int echelon)
      Parameters:
      echelon - the echelon to look up
      Returns:
      the rule declared for echelon by this convention alone, or null when it declares none. Callers wanting inherited rules must use Ruleset.findNamingTier(int).
    • isEmpty

      public boolean isEmpty()
      Returns:
      true when this convention declares no tiers at all, which is the state of every ruleset that does not carry a <formationNaming> element