DRAFT PR: Rename Force to Formation#8627
Conversation
|
|
||
| if (campaignOptions.isUseAtB() && force.getUnits().isEmpty()) { | ||
| combatTeams.remove(force.getId()); | ||
| if (campaignOptions.isUseAtB() && formation.getUnits().isEmpty()) { |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
| } | ||
|
|
||
| private static void processUnitNodes(Force retVal, Node wn, Version version) { | ||
| private static void processUnitNodes(Formation retVal, Node wn, Version version) { |
Check notice
Code scanning / CodeQL
Useless parameter Note
|
|
||
| // region Getters/Setters | ||
| public Map<LayeredForceIconLayer, List<ForcePieceIcon>> getPieces() { | ||
| public Map<LayeredFormationIconLayer, List<FormationPieceIcon>> getPieces() { |
Check notice
Code scanning / CodeQL
Exposing internal representation Note
| */ | ||
| public boolean isUnitInForce(UUID unitId, Force force, Campaign campaign) { | ||
| Vector<UUID> unitIds = force.getAllUnits(false); | ||
| public boolean isUnitInForce(UUID unitId, Formation formation, Campaign campaign) { |
Check notice
Code scanning / CodeQL
Useless parameter Note
| Force force = gui.getCampaign().getForce(Integer.parseInt(forceId)); | ||
| if (null != force) { | ||
| forces.add(force); | ||
| Formation formation = gui.getCampaign().getForce(Integer.parseInt(forceId)); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
| } | ||
| if (type.equals("FORCE")) { | ||
| force = gui.getCampaign().getForce(Integer.parseInt(id)); | ||
| formation = gui.getCampaign().getForce(Integer.parseInt(id)); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
| if (type.equals("FORCE")) { | ||
| force = gui.getCampaign().getForce(Integer.parseInt(id)); | ||
| if (force == null || force.isDeployed()) { | ||
| formation = gui.getCampaign().getForce(Integer.parseInt(id)); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
| gbc.gridx++; | ||
| add(new MMButton("btnExport", resources, "Export.text", | ||
| "LayeredForceIconCreationPanel.btnExport.toolTipText", evt -> exportAction()), gbc); | ||
| "LayeredFormationIconCreationPanel.btnExport.toolTipText", evt -> exportAction()), gbc); |
Check notice
Code scanning / CodeQL
Useless parameter Note
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8627 +/- ##
============================================
+ Coverage 12.48% 12.50% +0.01%
- Complexity 7553 7558 +5
============================================
Files 1294 1294
Lines 166215 166215
Branches 25055 25055
============================================
+ Hits 20758 20779 +21
+ Misses 143455 143437 -18
+ Partials 2002 1999 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sorry... This is a pretty big refactor. But I hope it'll be worth it.
Campaign Operations refers to the organization structure that units are in as a "Formation", not a "Force". Campaign Operations generally uses "Force" to refer to all of the players assets. This refactor is to bring MekHQ's terminology closer in line with Campaign Operations & to free up the class name
Force.There's still places that refer to a "Formation" as a "Force". We use the word "Force" a lot in the code, and many of those usages are still accurate - referring to the entire player force, or the verb used in properties files. This will be an ongoing cleanup task, I believe, to replace instances of
ForcewithFormation, as appropriate.