Class AbstractSkillGenerator
java.lang.Object
megamek.client.generator.skillGenerators.AbstractSkillGenerator
- Direct Known Subclasses:
ConstantSkillGenerator
,TotalWarfareSkillGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int[]
cleanReturn
(Entity entity, int... skills) This cleans up the return value before the final return, and by doing so to handling two specific use cases.int[]
generateRandomSkills
(Entity entity) Generates random skills for an entity based on the current settings of the random skill generator, but does not assign those new skills to that entityint[]
generateRandomSkills
(Entity entity, boolean forceClan) Generates random skills for an entity based on the current settings of the random skill generator, but does not assign those new skills to that entity.abstract int[]
generateRandomSkills
(Entity entity, boolean clanPilot, boolean forceClan) Generates random skills for an entity based on the current settings of the random skill generator, but does not assign those new skills to that entity.getLevel()
getType()
boolean
void
setForceClose
(boolean forceClose) void
setLevel
(SkillLevel level) void
setRandomSkills
(Entity entity) Generates random skills based on an entity crewmember by crewmember, and then assigns the values to the crew before sorting them.void
setRandomSkills
(Entity entity, boolean forceClan) Generates random skills based on an entity crewmember by crewmember, and then assigns the values to the crew before sorting them.void
setType
(SkillGeneratorType type)
-
Constructor Details
-
AbstractSkillGenerator
-
-
Method Details
-
getMethod
-
getLevel
-
setLevel
-
getType
-
setType
-
isForceClose
public boolean isForceClose() -
setForceClose
public void setForceClose(boolean forceClose) -
setRandomSkills
Generates random skills based on an entity crewmember by crewmember, and then assigns the values to the crew before sorting them.- Parameters:
entity
- the Entity whose skills are to be randomly set
-
setRandomSkills
Generates random skills based on an entity crewmember by crewmember, and then assigns the values to the crew before sorting them.- Parameters:
entity
- the Entity whose skills are to be randomly setforceClan
- forces the type to be clan if the crew are led by a clan pilot
-
generateRandomSkills
Generates random skills for an entity based on the current settings of the random skill generator, but does not assign those new skills to that entity- Parameters:
entity
- the Entity to generate a random skill array for- Returns:
- an integer array containing the (Gunnery, Piloting) skill values, or an alternative pairing if applicable [(Gunnery, Anti-'Mek) for infantry]
-
generateRandomSkills
Generates random skills for an entity based on the current settings of the random skill generator, but does not assign those new skills to that entity. The return value MUST be cleaned with cleanReturn for this setup to work properly.- Parameters:
entity
- the Entity to generate a random skill array forforceClan
- forces the type to be clan if the entity is a clan unit- Returns:
- an integer array containing the (Gunnery, Piloting) skill values, or an alternative pairing if applicable [(Gunnery, Anti-'Mek) for infantry]
-
generateRandomSkills
Generates random skills for an entity based on the current settings of the random skill generator, but does not assign those new skills to that entity. The return value MUST be cleaned with cleanReturn for this setup to work properly.- Parameters:
entity
- the Entity to generate a random skill array forclanPilot
- if the crew to generate a random skills array for are a clan crewforceClan
- forces the type to be clan if the crew are a clan crew- Returns:
- an integer array containing the (Gunnery, Piloting) skill values, or an alternative pairing if applicable [(Gunnery, Anti-'Mek) for infantry]
-
cleanReturn
This cleans up the return value before the final return, and by doing so to handling two specific use cases. The first is handling Infantry Anti-'Mek skill generation properly by directly tying it into entity being Anti-'Mek trained. The second is the force close option, which forces piloting to be gunnery plus one- Parameters:
entity
- the entity the skill is being generated forskills
- the skill array to cleanup before the final return- Returns:
- the modified skill array
-