Class Ruleset

java.lang.Object
megamek.client.ratgenerator.Ruleset

public class Ruleset extends Object
Container for all the rule nodes for a faction. Has methods for processing the rules to fill out a ForceDescriptor.
  • Method Details

    • substituteConstants

      public static String substituteConstants(String str)
    • findRuleset

      public static Ruleset findRuleset(ForceDescriptor fd)
    • findRuleset

      public static Ruleset findRuleset(String faction)
    • getCustomRankBase

      @Deprecated(since="0.51.0", forRemoval=true) public int getCustomRankBase()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getCustomRanks

      @Deprecated(since="0.51.0", forRemoval=true) public HashMap<Integer,String> getCustomRanks()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • processRoot

      public void processRoot(ForceDescriptor fd, Ruleset.ProgressListener l)
    • getRatingIndex

      public int getRatingIndex(String key)
    • getRatingsAtOrWorseThan

      public List<String> getRatingsAtOrWorseThan(String rating)
      Returns the given equipment rating followed by every worse rating in this ruleset's rating system, ordered from the given rating down to the worst. Used as an equipment-rating fallback ladder during unit generation: a force tries its own rating first and only steps down to worse-equipped ratings when nothing can be generated, never to a better rating. If the rating is not part of this system, the list contains only the rating itself.
      Parameters:
      rating - the force's own equipment rating
      Returns:
      the rating and all worse ratings, closest first
    • getDefaultUnitType

      public Integer getDefaultUnitType(ForceDescriptor fd)
    • getDefaultEschelon

      public String getDefaultEschelon(ForceDescriptor fd)
    • getDefaultRating

      public String getDefaultRating(ForceDescriptor fd)
    • getTOCNode

      public TOCNode getTOCNode()
    • findForceNode

      public ForceNode findForceNode(ForceDescriptor fd)
    • findForceNode

      public ForceNode findForceNode(ForceDescriptor fd, int eschelon, boolean augmented)
    • getEschelonNames

      public HashMap<String,String> getEschelonNames(String unitType)
    • getEschelonName

      public String getEschelonName(ForceDescriptor fd)
    • getCoNode

      public CommanderNode getCoNode(ForceDescriptor fd)
    • getXoNode

      public CommanderNode getXoNode(ForceDescriptor fd)
    • getParent

      public String getParent()
    • loadConstants

      public static void loadConstants(File f)
    • loadData

      public static void loadData()
    • isInitialized

      public static boolean isInitialized()
    • isInitializing

      public static boolean isInitializing()
    • getFaction

      public String getFaction()