Improved MissionRole Switch Cases & Role List #5289
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Currently there are a number of unused roles listed as viable cases in
megamek/src/megamek/client/ratgenerator/MissionRole.java
.There are also missing or incorrect roles listed in
megamek/docs/RAT Stuff/rat-generator.txt
.Solutions
MissionRole.java
I have gone through and removed any unused cases.
rat-generator.txt
I have clarified that either
infantry_support
orinf_support
are accepted cases for the infantry support role. Both are in use and, while it might be advantageous to unify everything to use the same case, that is beyond the scope of this PR.I have replaced 'incindiary' with 'incendiary' as the suggested case for units that can set fires. In #5288 Nick suggested we leave uses of 'incindiary' intact, however replacement in this instance leaves other uses intact while ensuring that future uses of the case are using the correct spelling. As this is user facing, I also wanted to ensure that the spelling was correct.
I have added the missing
mechanized_ba
role and assigned it the definitioneligible to be carried by Omni units as mechanized BA
.I changed
pocket ws
topocket_warship
, as whilepocket ws
would have been accepted, its only use is inrat-generator.txt
so by changing it topocket_warship
I was able to remove that case fromMissionRole.java
.Note
This initially started out as an attempt to investigate #5267. However, upon investigation, I found that existing functions relied upon the cases (when used) as currently implemented. As I was unable to find which functions were reliant on the current role cases, I opted instead to just leave the class intact and to only tidy things up so that we weren't checking for unused cases.