New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a biome selector to the map generation dialog #3085
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #3085 +/- ##
=============================================
+ Coverage 59.02% 59.10% +0.08%
- Complexity 4408 4415 +7
=============================================
Files 565 565
Lines 20086 20122 +36
Branches 989 990 +1
=============================================
+ Hits 11856 11894 +38
+ Misses 7713 7710 -3
- Partials 517 518 +1
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
841d230
to
c1f711c
Compare
src/main/java/com/faforever/client/game/CreateGameController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/faforever/client/game/GenerateMapController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/faforever/client/game/GenerateMapController.java
Outdated
Show resolved
Hide resolved
340ba1d
to
7dec41f
Compare
Now that the text for random style and biome is the same, should the two constants GENERATOR_RANDOM_STYLE and GENERATOR_RANDOM_BIOME be consolidated into one? |
@@ -358,6 +373,20 @@ protected void setStyles(List<String> styles) { | |||
mapStyleLabel.setVisible(true); | |||
} | |||
|
|||
protected void setBiomes(List<String> biomes) { | |||
biomes.add(0, MapGeneratorService.GENERATOR_RANDOM_BIOME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this now this and set styles really should make a copy of the list that is guaranteed to be mutable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do I do that and why is that desirable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is desirable because this method could be passed an immutable list so the add function would fail.
Or if a mutable list is passed this then modifies that list in ways that the caller may not be expecting so it breaks something higher up.
You would implement it by just creating a new list and then adding this list to that one.
ad04107
to
bad56bf
Compare
bad56bf
to
9805ecb
Compare
Requires FAForever/Neroxis-Map-Generator#382 to be merged and released to actually be able to load the biomes list