Skip to content

Commit

Permalink
move modifiedTemperature to AtBScenario
Browse files Browse the repository at this point in the history
  • Loading branch information
kuronekochomusuke committed May 4, 2024
1 parent 33523d9 commit e783140
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion MekHQ/src/mekhq/GameThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void run() {
planetaryConditions.setWind(scenario.getWind());
planetaryConditions.setFog(scenario.getFog());
planetaryConditions.setAtmosphere(scenario.getAtmosphere());
planetaryConditions.setTemperature(scenario.getModifiedTemperature());
planetaryConditions.setTemperature(scenario.getTemperature());
planetaryConditions.setGravity(scenario.getGravity());
planetaryConditions.setEMI(scenario.getEMI());
planetaryConditions.setBlowingSand(scenario.getBlowingSand());
Expand Down
12 changes: 12 additions & 0 deletions MekHQ/src/mekhq/campaign/mission/AtBScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public abstract class AtBScenario extends Scenario implements IAtBScenario {

private static TerrainConditionsOddsManifest TCO;
private static StratconBiomeManifest SB;
private int modifiedTemperature;
//endregion Variable Declarations

public AtBScenario () {
Expand Down Expand Up @@ -305,6 +306,14 @@ private void initBattle(Campaign campaign) {
}
}

public int getModifiedTemperature() {
return modifiedTemperature;
}

public void setModifiedTemperature(int modifiedTemperature) {
this.modifiedTemperature = modifiedTemperature;
}

public void setTerrain() {
Map<String, StratconBiomeManifest.MapTypeList> mapTypes = SB.getBiomeMapTypes();
List<String> keys = mapTypes.keySet().stream().sorted().collect(Collectors.toList());
Expand Down Expand Up @@ -1505,6 +1514,7 @@ protected void writeToXMLEnd(final PrintWriter pw, int indent) {
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "deploymentDelay", deploymentDelay);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "lanceCount", lanceCount);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "rerollsRemaining", rerollsRemaining);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "modifiedTemperature", modifiedTemperature);

if (null != bigBattleAllies && !bigBattleAllies.isEmpty()) {
MHQXMLUtility.writeSimpleXMLOpenTag(pw, indent++, "bigBattleAllies");
Expand Down Expand Up @@ -1603,6 +1613,8 @@ protected void loadFieldsFromXmlNode(final Node wn, final Version version, final
lanceCount = Integer.parseInt(wn2.getTextContent());
} else if (wn2.getNodeName().equalsIgnoreCase("rerollsRemaining")) {
rerollsRemaining = Integer.parseInt(wn2.getTextContent());
} else if (wn2.getNodeName().equalsIgnoreCase("modifiedTemperature")) {
modifiedTemperature = Integer.parseInt(wn2.getTextContent());
} else if (wn2.getNodeName().equalsIgnoreCase("alliesPlayer")) {
NodeList nl2 = wn2.getChildNodes();
for (int i = 0; i < nl2.getLength(); i++) {
Expand Down
9 changes: 0 additions & 9 deletions MekHQ/src/mekhq/campaign/mission/Scenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public class Scenario {
protected Fog fog;
protected Atmosphere atmosphere;
private int temperature;
private int modifiedTemperature;
protected float gravity;
private EMI emi;
private BlowingSand blowingSand;
Expand Down Expand Up @@ -396,14 +395,6 @@ public void setTemperature(int temperature) {
this.temperature = temperature;
}

public int getModifiedTemperature() {
return modifiedTemperature;
}

public void setModifiedTemperature(int modifiedTemperature) {
this.modifiedTemperature = modifiedTemperature;
}

public float getGravity() {
return gravity;
}
Expand Down
2 changes: 1 addition & 1 deletion MekHQ/src/mekhq/gui/view/ScenarioViewPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ private void fillMapData() {
leftGbc.gridy++;
pnlMap.add(lblTemperature, leftGbc);

JLabel lblTemperatureDesc = new JLabel(PlanetaryConditions.getTemperatureDisplayableName(scenario.getModifiedTemperature()));
JLabel lblTemperatureDesc = new JLabel(PlanetaryConditions.getTemperatureDisplayableName(scenario.getTemperature()));
rightGbc.gridy++;
pnlMap.add(lblTemperatureDesc, rightGbc);

Expand Down

0 comments on commit e783140

Please sign in to comment.