Class RATManager

All Implemented Interfaces:
IUnitGenerator

@Deprecated(since="0.50.07", forRemoval=true) public class RATManager extends AbstractUnitGenerator
Deprecated, for removal: This API element is subject to removal in a future version.
No longer in use
Provides a front end to RandomUnitGenerator that allows the user to generate units based on criteria such as faction, unit type, and weight class. May be restricted to a certain subset of all available RATs.
  • Field Summary

  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<megamek.common.loaders.MekSummary>
    generate(int count, String faction, int unitType, int weightClass, int year, int quality, Collection<megamek.common.units.EntityMovementMode> movementModes, Collection<megamek.client.ratgenerator.MissionRole> missionRoles, Predicate<megamek.common.loaders.MekSummary> filter)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a list of units using additional parameters specific to the generation method.
    List<megamek.common.loaders.MekSummary>
    generate(int count, String faction, int unitType, int weightClass, int year, int quality, Predicate<megamek.common.loaders.MekSummary> filter)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a list of units with an additional test function.
    List<megamek.common.loaders.MekSummary>
    generate(int count, UnitGeneratorParameters parameters)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a list of mek summaries from a RAT determined by the given faction, quality and other parameters.
    megamek.common.loaders.MekSummary
    generate(String faction, int unitType, int weightClass, int year, int quality, Collection<megamek.common.units.EntityMovementMode> movementModes, Collection<megamek.client.ratgenerator.MissionRole> missionRoles, Predicate<megamek.common.loaders.MekSummary> filter)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generate a unit using additional parameters specific to the generation method.
    megamek.common.loaders.MekSummary
    generate(String faction, int unitType, int weightClass, int year, int quality, Predicate<megamek.common.loaders.MekSummary> filter)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generate a single unit.
    megamek.common.loaders.MekSummary
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a single unit, for the given faction, using the given set of parameters.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    isSupportedUnitType(int unitType)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Scans RatData directory for list of available RATs that can be used by CampaignOptions to provide a list.
    void
    removeRAT(String collection)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove RAT collection from list of selected RATs
    void
    setIgnoreRatEra(boolean ignore)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setSelectedRATs(String[] selected)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Replaces selected RAT collections with new list
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Replaces selected RAT collections with new list
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class mekhq.campaign.universe.AbstractUnitGenerator

    generateTurrets

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface mekhq.campaign.universe.IUnitGenerator

    generate, generate, generate, generate, generate, generate
  • Constructor Details

    • RATManager

      public RATManager()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • updateRATConfig

      public void updateRATConfig(OptionsChangedEvent ev)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setSelectedRATs

      public void setSelectedRATs(List<String> selected)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Replaces selected RAT collections with new list
      Parameters:
      selected - List of RAT collection names
    • setSelectedRATs

      public void setSelectedRATs(String[] selected)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Replaces selected RAT collections with new list
      Parameters:
      selected - Array of RAT collection names
    • removeRAT

      public void removeRAT(String collection)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Remove RAT collection from list of selected RATs
      Parameters:
      collection - Name of RAT collection to remove
    • setIgnoreRatEra

      public void setIgnoreRatEra(boolean ignore)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getAllRATCollections

      public static Map<String,List<Integer>> getAllRATCollections()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      A map of all collections available with a list of eras included
    • populateCollectionNames

      public static void populateCollectionNames()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Scans RatData directory for list of available RATs that can be used by CampaignOptions to provide a list.
    • isSupportedUnitType

      public boolean isSupportedUnitType(int unitType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      unitType - UnitType constant
      Returns:
      true if the generator supports the unit type
    • generate

      @Nullable public megamek.common.loaders.MekSummary generate(String faction, int unitType, int weightClass, int year, int quality, @Nullable Predicate<megamek.common.loaders.MekSummary> filter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IUnitGenerator
      Generate a single unit.
      Parameters:
      faction - Faction shortname
      unitType - UnitType constant
      weightClass - EntityWeightClass constant, or -1 for unspecified
      year - The year of the campaign date
      quality - Index of equipment rating, with zero being the lowest quality.
      filter - All generated units return true when the filter function is applied.
      Returns:
      A unit that matches the criteria
    • generate

      @Nullable public megamek.common.loaders.MekSummary generate(String faction, int unitType, int weightClass, int year, int quality, Collection<megamek.common.units.EntityMovementMode> movementModes, Collection<megamek.client.ratgenerator.MissionRole> missionRoles, @Nullable Predicate<megamek.common.loaders.MekSummary> filter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IUnitGenerator
      Generate a unit using additional parameters specific to the generation method.
      Parameters:
      faction - Faction shortname
      unitType - UnitType constant
      weightClass - EntityWeightClass constant, or -1 for unspecified
      year - The year of the campaign date
      quality - Index of equipment rating, with zero being the lowest quality.
      movementModes - A collection of various movement modes
      missionRoles - A collection of various mission roles
      filter - All generated units return true when the filter function is applied.
      Returns:
      A unit that matches the criteria
    • generate

      public List<megamek.common.loaders.MekSummary> generate(int count, String faction, int unitType, int weightClass, int year, int quality, @Nullable Predicate<megamek.common.loaders.MekSummary> filter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IUnitGenerator
      Generates a list of units with an additional test function.
      Parameters:
      count - The number of units to generate
      faction - Faction shortname
      unitType - UnitType constant
      weightClass - EntityWeightClass constant, or -1 for unspecified
      year - The year of the campaign date
      quality - Index of equipment rating, with zero being the lowest quality.
      filter - All generated units return true when the filter function is applied.
      Returns:
      A list of units matching the criteria.
    • generate

      public List<megamek.common.loaders.MekSummary> generate(int count, String faction, int unitType, int weightClass, int year, int quality, Collection<megamek.common.units.EntityMovementMode> movementModes, Collection<megamek.client.ratgenerator.MissionRole> missionRoles, @Nullable Predicate<megamek.common.loaders.MekSummary> filter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IUnitGenerator
      Generates a list of units using additional parameters specific to the generation method.
      Parameters:
      count - The number of units to generate
      faction - Faction shortname
      unitType - UnitType constant
      weightClass - EntityWeightClass constant, or -1 for unspecified
      year - The year of the campaign date
      quality - Index of equipment rating, with zero being the lowest quality.
      movementModes - A collection of various movement modes
      missionRoles - A collection of various mission roles
      filter - All generated units return true when the filter function is applied.
      Returns:
      A list of units matching the criteria.
    • generate

      @Nullable public megamek.common.loaders.MekSummary generate(UnitGeneratorParameters parameters)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates a single unit, for the given faction, using the given set of parameters. Note that some of the properties of the parameters may be ignored for generation mechanisms that aren't the RAT Generator
      Parameters:
      parameters - data structure containing unit generation parameters
      Returns:
      Generated units. Null if none generated.
    • generate

      public List<megamek.common.loaders.MekSummary> generate(int count, UnitGeneratorParameters parameters)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates a list of mek summaries from a RAT determined by the given faction, quality and other parameters. Note that for the purposes of this implementation, the only properties of "parameters" used are unit type, year, weight classes and movement modes. We also expect the rating to be a number 1-5, rather than A-F.
      Parameters:
      count - How many units to generate
      parameters - RATGenerator parameters (some are ignored)
      Returns:
      List of generated units. Empty if none are generated.