Skip to content

Commit

Permalink
Fix plurality
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Jun 19, 2024
1 parent c97ee72 commit 5ac5b71
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ private void initCustomStyleOptions() {
generatorPrefs.reclaimDensityMaxProperty().bind(reclaimDensitySlider.highValueProperty());
reclaimDensitySlider.setLowValue(generatorPrefs.getReclaimDensityMin());
generatorPrefs.reclaimDensityMinProperty().bind(reclaimDensitySlider.lowValueProperty());
resourcesDensitySlider.setHighValue(generatorPrefs.getResourcesDensityMax());
generatorPrefs.resourcesDensityMaxProperty().bind(resourcesDensitySlider.highValueProperty());
resourcesDensitySlider.setLowValue(generatorPrefs.getResourcesDensityMin());
generatorPrefs.resourcesDensityMinProperty().bind(resourcesDensitySlider.lowValueProperty());
resourcesDensitySlider.setHighValue(generatorPrefs.getResourceDensityMax());
generatorPrefs.resourceDensityMaxProperty().bind(resourcesDensitySlider.highValueProperty());
resourcesDensitySlider.setLowValue(generatorPrefs.getResourceDensityMin());
generatorPrefs.resourceDensityMinProperty().bind(resourcesDensitySlider.lowValueProperty());
}

private void initSeedField() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public record GeneratorOptions(
String style,
String terrainStyle,
String textureStyle,
String resourceStyle,
String propStyle, Float reclaimDensity, Float resourceDensity,
String resourceStyle, String propStyle, Float reclaimDensity, Float resourceDensity,
String commandLineArgs
) {}
28 changes: 14 additions & 14 deletions src/main/java/com/faforever/client/preferences/GeneratorPrefs.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public class GeneratorPrefs {
private final StringProperty propStyle = new SimpleStringProperty("");
private final IntegerProperty reclaimDensityMin = new SimpleIntegerProperty(0);
private final IntegerProperty reclaimDensityMax = new SimpleIntegerProperty(127);
private final IntegerProperty resourcesDensityMin = new SimpleIntegerProperty(0);
private final IntegerProperty resourcesDensityMax = new SimpleIntegerProperty(127);
private final IntegerProperty resourceDensityMin = new SimpleIntegerProperty(0);
private final IntegerProperty resourceDensityMax = new SimpleIntegerProperty(127);

public GenerationType getGenerationType() {
return generationType.get();
Expand Down Expand Up @@ -233,27 +233,27 @@ public void setReclaimDensityMax(int max) {
this.reclaimDensityMax.set(max);
}

public int getResourcesDensityMin() {
return resourcesDensityMin.get();
public int getResourceDensityMin() {
return resourceDensityMin.get();
}

public IntegerProperty resourcesDensityMinProperty() {
return resourcesDensityMin;
public IntegerProperty resourceDensityMinProperty() {
return resourceDensityMin;
}

public void setResourcesDensityMin(int min) {
this.resourcesDensityMin.set(min);
public void setResourceDensityMin(int min) {
this.resourceDensityMin.set(min);
}

public int getResourcesDensityMax() {
return resourcesDensityMax.get();
public int getResourceDensityMax() {
return resourceDensityMax.get();
}

public IntegerProperty resourcesDensityMaxProperty() {
return resourcesDensityMax;
public IntegerProperty resourceDensityMaxProperty() {
return resourceDensityMax;
}

public void setResourcesDensityMax(int max) {
this.resourcesDensityMax.set(max);
public void setResourceDensityMax(int max) {
this.resourceDensityMax.set(max);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public void unbindProperties() {
generatorPrefs.commandLineArgsProperty().unbind();
generatorPrefs.reclaimDensityMinProperty().unbind();
generatorPrefs.reclaimDensityMaxProperty().unbind();
generatorPrefs.resourcesDensityMinProperty().unbind();
generatorPrefs.resourcesDensityMaxProperty().unbind();
generatorPrefs.resourceDensityMinProperty().unbind();
generatorPrefs.resourceDensityMaxProperty().unbind();
}

@BeforeEach
Expand Down Expand Up @@ -453,8 +453,8 @@ public void testGetGenerateMapNoNameCustomStyle() {
generatorPrefs.setNumTeams(2);
generatorPrefs.setMapSizeInKm(10.0);
generatorPrefs.setGenerationType(GenerationType.CASUAL);
generatorPrefs.setResourcesDensityMin(5);
generatorPrefs.setResourcesDensityMax(5);
generatorPrefs.setResourceDensityMin(5);
generatorPrefs.setResourceDensityMax(5);
generatorPrefs.setReclaimDensityMin(10);
generatorPrefs.setReclaimDensityMax(10);

Expand Down

0 comments on commit 5ac5b71

Please sign in to comment.