java.lang.Object
mekhq.campaign.universe.commandGeneration.ratgen.RankAssigner

public final class RankAssigner extends Object
Applies rank values from ForceDescriptor.getCo() / getXo() CrewDescriptors onto MekHQ Persons.

Phase 1: minimal pass-through of descriptor.getRank() as the Person's rank index. Phase 3 will port the AtB starting-force preset's faction-aware rank rules (AtBCompanyGenerator.generateCommandingOfficerRank) as a factionRankPolicy(faction) lookup and translate via the campaign's rank system, so that ComStar / WoB ranks resolve correctly.

This class exists as a seam now so Phase 3's tree-walk rank assignment plugs in without further caller changes.

  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    apply(megamek.client.ratgenerator.CrewDescriptor descriptor, Person person)
    Applies the descriptor's rank value to the given Person, if both are non-null and the descriptor's rank is meaningful (> 0).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • apply

      public static void apply(megamek.client.ratgenerator.CrewDescriptor descriptor, Person person)
      Applies the descriptor's rank value to the given Person, if both are non-null and the descriptor's rank is meaningful (> 0).
      Parameters:
      descriptor - the source CrewDescriptor; may be null
      person - the target Person; may be null