Package mekhq.campaign.universe
Class RATManager
java.lang.Object
mekhq.campaign.universe.AbstractUnitGenerator
mekhq.campaign.universe.RATManager
- All Implemented Interfaces:
IUnitGenerator
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
Fields inherited from interface mekhq.campaign.universe.IUnitGenerator
ALL_BATTLE_ARMOR_MODES, ALL_INFANTRY_MODES, BATTLE_ARMOR_MIN_WEIGHT, FOOT_PLATOON_INFANTRY_WEIGHT, MIXED_TANK_VTOL, NO_WEIGHT_LIMIT
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionList<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
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.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
Deprecated, for removal: This API element is subject to removal in a future version.Remove RAT collection from list of selected RATsvoid
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 listvoid
setSelectedRATs
(List<String> selected) Deprecated, for removal: This API element is subject to removal in a future version.Replaces selected RAT collections with new listvoid
Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class mekhq.campaign.universe.AbstractUnitGenerator
generateTurrets
-
Constructor Details
-
RATManager
public RATManager()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
updateRATConfig
Deprecated, for removal: This API element is subject to removal in a future version. -
setSelectedRATs
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
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
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
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 shortnameunitType
- UnitType constantweightClass
- EntityWeightClass constant, or -1 for unspecifiedyear
- The year of the campaign datequality
- 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 shortnameunitType
- UnitType constantweightClass
- EntityWeightClass constant, or -1 for unspecifiedyear
- The year of the campaign datequality
- Index of equipment rating, with zero being the lowest quality.movementModes
- A collection of various movement modesmissionRoles
- A collection of various mission rolesfilter
- 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 generatefaction
- Faction shortnameunitType
- UnitType constantweightClass
- EntityWeightClass constant, or -1 for unspecifiedyear
- The year of the campaign datequality
- 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 generatefaction
- Faction shortnameunitType
- UnitType constantweightClass
- EntityWeightClass constant, or -1 for unspecifiedyear
- The year of the campaign datequality
- Index of equipment rating, with zero being the lowest quality.movementModes
- A collection of various movement modesmissionRoles
- A collection of various mission rolesfilter
- All generated units return true when the filter function is applied.- Returns:
- A list of units matching the criteria.
-
generate
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 generateparameters
- RATGenerator parameters (some are ignored)- Returns:
- List of generated units. Empty if none are generated.
-