Skip to content

Commit

Permalink
Refactored seedPreDeployedForces method to be private
Browse files Browse the repository at this point in the history
Changed the visibility of the seedPreDeployedForces method to private and added a detailed Javadoc comment explaining its functionality. Removed redundant comments from the initializeTrackState method to improve code readability.
  • Loading branch information
IllianiCBT committed Nov 21, 2024
1 parent 363b297 commit 11ba6b5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions MekHQ/src/mekhq/campaign/stratcon/StratconContractInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,18 @@ public static void initializeCampaignState(AtBContract contract, Campaign campai
// now we're done
}

public static boolean seedPreDeployedForces(AtBContract contract, Campaign campaign, StratconTrackState track) {
/**
* Seeds pre-deployed (hidden) forces in a {@link StratconTrackState}, taking into account
* contract type and intensity.
*
* @param contract the current contract
* @param campaign the current campaign.
* @param track the relevant {@link StratconTrackState}
*
* @return a boolean where {@code true} means forces were not deployed due to being garrison
* type or pirate hunting and {@code false} implies forces have been deployed successfully.
*/
private static boolean seedPreDeployedForces(AtBContract contract, Campaign campaign, StratconTrackState track) {
AtBContractType contractType = contract.getContractType();

// If the contract is a garrison type, we don't want to generate what will appear to be
Expand Down Expand Up @@ -254,11 +265,6 @@ public static boolean seedPreDeployedForces(AtBContract contract, Campaign campa
public static StratconTrackState initializeTrackState(int numLances, int scenarioOdds,
int deploymentTime, int planetaryTemp,
double planetaryDiameter) {
// to initialize a track,
// 1. we set the # of required lances
// 2. set the track size to a total of numlances * 84 hexes, a rectangle that is
// wider than it is taller

StratconTrackState retVal = new StratconTrackState();
retVal.setRequiredLanceCount(numLances);

Expand Down

0 comments on commit 11ba6b5

Please sign in to comment.