Package megamek.common.universe
Class Factions2
java.lang.Object
megamek.common.universe.Factions2
This class manages the unified Faction2 class that combines MHQ's Faction and the RATGenerator's FactionRecord and
makes it available to all project parts.
Faction data is loaded from data/universe/factions and .../commands, as well as from the same folders in the user directory, if available.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFaction(String factionCode) static Factions2static Factions2getInstance(boolean useTestDirectory) static voidsetInstance(Factions2 instance)
-
Field Details
-
FACTIONS2_TEST_DIRECTORY
- See Also:
-
-
Constructor Details
-
Factions2
This constructor is intended for unit testing only and will load factions *only* from the provided path. The path is used as it is.- Parameters:
factionsDataPath- The path to load factions data from
-
-
Method Details
-
getInstance
-
getInstance
-
setInstance
-
getFactions
- Returns:
- All available factions. The returned Collection is a view of the internal faction list and must not be modified.
-
getFaction
- Parameters:
factionCode- The faction's key such as LA, HL, CGS or LA.DG- Returns:
- The faction for the given faction code, if any.
-