Class TOCNode

java.lang.Object
megamek.client.ratgenerator.RulesetNode
megamek.client.ratgenerator.TOCNode

public class TOCNode extends RulesetNode
Contains details about which units and echelon levels are available to this unit in given eras.
  • Field Details

  • Constructor Details

    • TOCNode

      protected TOCNode()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Whether this table of contents offers anything. A ruleset file with no <toc> still gets an empty one, which means "use the parent's", not "offer nothing".
      Returns:
      true when there is no unit type, echelon, rating or flag option at all
    • offersUnitTypes

      public boolean offersUnitTypes(String faction, int year)
      Whether these menus offer a faction any unit type in a year. The Force Generator leaves out a faction they do not, since it could only show empty menus.
      Parameters:
      faction - the faction key
      year - the year
      Returns:
      true when at least one unit type option applies
    • findUnitTypes

      public ValueNode findUnitTypes(ForceDescriptor fd)
    • findEchelons

      public ValueNode findEchelons(ForceDescriptor fd)
    • findRatings

      public ValueNode findRatings(ForceDescriptor fd)
    • findFlags

      public ValueNode findFlags(ForceDescriptor fd)
    • createFromXml

      public static TOCNode createFromXml(Node node)
    • loadFromXml

      protected void loadFromXml(Node node)
      Overrides:
      loadFromXml in class RulesetNode