Skip to content

Commit

Permalink
Rename "IN_RESERVE" to "RESERVE" in CombatRole references
Browse files Browse the repository at this point in the history
Updated all instances of "IN_RESERVE" to "RESERVE" across the codebase for consistency and simplicity. Adjustments included enums, method names, and references in tooltips, ensuring uniformity in terminology.
  • Loading branch information
IllianiCBT committed Dec 21, 2024
1 parent fec6802 commit a559ba6
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions MekHQ/resources/mekhq/resources/Mission.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ CombatRole.TRAINING.text=Training
CombatRole.TRAINING.toolTipText=The force has been tasked with trained ultra green and green members of the force under the leadership of a veteran or elite officer.
CombatRole.AUXILIARY.text=Auxiliary
CombatRole.AUXILIARY.toolTipText=The force has been tasked with supporting other forces.
CombatRole.IN_RESERVE.text=In Reserve
CombatRole.IN_RESERVE.toolTipText=The force is not currently assigned to combat duties.
CombatRole.RESERVE.text=Reserve
CombatRole.RESERVE.toolTipText=The force is not currently assigned to combat duties.

# AtBMoraleLevel Enum
AtBMoraleLevel.ROUTED.text=Routed
Expand Down
2 changes: 1 addition & 1 deletion MekHQ/src/mekhq/campaign/Campaign.java
Original file line number Diff line number Diff line change
Expand Up @@ -3768,7 +3768,7 @@ public int getDeploymentDeficit(AtBContract contract) {

final CombatRole requiredLanceRole = contract.getContractType().getRequiredLanceRole();
for (CombatTeam combatTeam : combatTeams.values()) {
if (!(combatTeam.getRole().isInReserve() || combatTeam.getRole().isAuxiliary())
if (!(combatTeam.getRole().isReserve() || combatTeam.getRole().isAuxiliary())
&& (combatTeam.getMissionId() == contract.getId())) {
total++;
if (combatTeam.getRole() == requiredLanceRole) {
Expand Down
6 changes: 3 additions & 3 deletions MekHQ/src/mekhq/campaign/CampaignOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -4478,15 +4478,15 @@ public void setPlayerControlsAttachedUnits(final boolean playerControlsAttachedU
* This method calculates the battle chance percentage for the provided combat role based on
* its ordinal position in the {@code atbBattleChance} array. If StratCon is enabled, the
* method immediately returns {@code 0}.
* Roles marked as {@link CombatRole#IN_RESERVE} or as {@link CombatRole#AUXILIARY} are not
* Roles marked as {@link CombatRole#RESERVE} or as {@link CombatRole#AUXILIARY} are not
* eligible for battles and also return {@code 0}.
* </p>
*
* @param role the {@link CombatRole} to evaluate the battle chance for.
* @return the chance of having a battle for the specified role. Returns:
* <ul>
* <li>{@code 0} if StratCon is enabled.</li>
* <li>{@code 0} if the role is {@link CombatRole#IN_RESERVE} or
* <li>{@code 0} if the role is {@link CombatRole#RESERVE} or
* {@link CombatRole#AUXILIARY}.</li>
* <li>A non-zero value from the {@code atbBattleChance} array corresponding to the
* role otherwise.</li>
Expand All @@ -4497,7 +4497,7 @@ public int getAtBBattleChance(CombatRole role) {
return 0;
}

if (role.isInReserve() || role.isAuxiliary()) {
if (role.isReserve() || role.isAuxiliary()) {
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion MekHQ/src/mekhq/campaign/force/CombatTeam.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public CombatTeam() {}

public CombatTeam(int forceId, Campaign campaign) {
this.forceId = forceId;
role = CombatRole.IN_RESERVE;
role = CombatRole.RESERVE;
missionId = -1;
for (AtBContract contract : campaign.getActiveAtBContracts()) {
missionId = ((contract.getParentContract() == null)
Expand Down
4 changes: 2 additions & 2 deletions MekHQ/src/mekhq/campaign/mission/AtBScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public abstract class AtBScenario extends Scenario implements IAtBScenario {
public AtBScenario() {
super();
combatTeamId = -1;
combatRole = CombatRole.IN_RESERVE;
combatRole = CombatRole.RESERVE;
alliesPlayer = new ArrayList<>();
alliesPlayerStub = new ArrayList<>();
attachedUnitIds = new ArrayList<>();
Expand Down Expand Up @@ -237,7 +237,7 @@ public void initialize(Campaign c, CombatTeam lance, boolean attacker, LocalDate

if (null == lance) {
combatTeamId = -1;
combatRole = CombatRole.IN_RESERVE;
combatRole = CombatRole.RESERVE;
} else {
this.combatTeamId = lance.getForceId();
combatRole = lance.getRole();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public CombatRole getRequiredLanceRole() {
case RECON_RAID:
return CombatRole.RECON;
default:
return CombatRole.IN_RESERVE;
return CombatRole.RESERVE;
}
}

Expand Down
8 changes: 4 additions & 4 deletions MekHQ/src/mekhq/campaign/mission/enums/CombatRole.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public enum CombatRole {
RECON("CombatRole.RECON.text", "CombatRole.RECON.toolTipText"),
TRAINING("CombatRole.TRAINING.text", "CombatRole.TRAINING.toolTipText"),
AUXILIARY("CombatRole.AUXILIARY.text", "CombatRole.AUXILIARY.toolTipText"),
IN_RESERVE("CombatRole.IN_RESERVE.text", "CombatRole.IN_RESERVE.toolTipText");
RESERVE("CombatRole.RESERVE.text", "CombatRole.RESERVE.toolTipText");
// endregion Enum Declarations

// region Variable Declarations
Expand Down Expand Up @@ -74,8 +74,8 @@ public boolean isAuxiliary() {
return this == AUXILIARY;
}

public boolean isInReserve() {
return this == IN_RESERVE;
public boolean isReserve() {
return this == RESERVE;
}
// endregion Boolean Comparison Methods

Expand Down Expand Up @@ -111,7 +111,7 @@ public static CombatRole parseFromString(final String text) {
MMLogger.create(CombatRole.class)
.error("Unable to parse " + text + " into an CombatRole. Returning IN_RESERVE.");

return IN_RESERVE;
return RESERVE;
}
// endregion File I/O

Expand Down
4 changes: 2 additions & 2 deletions MekHQ/src/mekhq/campaign/stratcon/StratconRulesManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ public static List<Integer> getAvailableForceIDs(Campaign campaign, AtBContract
}

// So long as the combat team isn't In Reserve or Auxiliary, they are eligible to be deployed
if (!combatTeam.getRole().isInReserve() && !combatTeam.getRole().isAuxiliary()) {
if (!combatTeam.getRole().isReserve() && !combatTeam.getRole().isAuxiliary()) {
suitableForces.add(combatTeam.getForceId());
}
}
Expand Down Expand Up @@ -1978,7 +1978,7 @@ public static List<Integer> getAvailableForceIDs(int unitType, Campaign campaign
continue;
}

if (formation.getRole().isInReserve()) {
if (formation.getRole().isReserve()) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion MekHQ/src/mekhq/gui/view/LanceAssignmentView.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public Object getValueAt(int row, int column) {
int t = 0;
for (CombatTeam combatTeam : campaign.getAllCombatTeams()) {
if (data.get(row).equals(combatTeam.getContract(campaign))
&& (combatTeam.getRole() != CombatRole.IN_RESERVE)
&& (combatTeam.getRole() != CombatRole.RESERVE)
&& combatTeam.isEligible(campaign)) {
t++;
}
Expand Down

0 comments on commit a559ba6

Please sign in to comment.