mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Merge branch 'sort_flip_results' into 'master'
Sort coing flips for Krark's Thumb See merge request core-developers/forge!2335
This commit is contained in:
@@ -1409,11 +1409,16 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
final boolean call) {
|
final boolean call) {
|
||||||
final String[] labelsSrc = call ? new String[] { "heads", "tails" }
|
final String[] labelsSrc = call ? new String[] { "heads", "tails" }
|
||||||
: new String[] { "win the flip", "lose the flip" };
|
: new String[] { "win the flip", "lose the flip" };
|
||||||
final ImmutableList.Builder<String> strResults = ImmutableList.builder();
|
final List<String> sortedResults = new ArrayList<String>();
|
||||||
for (int i = 0; i < results.length; i++) {
|
for (boolean result : results) {
|
||||||
strResults.add(labelsSrc[results[i] ? 0 : 1]);
|
sortedResults.add(labelsSrc[result ? 0 : 1]);
|
||||||
}
|
}
|
||||||
return getGui().one(sa.getHostCard().getName() + " - Choose a result", strResults.build()).equals(labelsSrc[0]);
|
|
||||||
|
Collections.sort(sortedResults);
|
||||||
|
if (!call) {
|
||||||
|
Collections.reverse(sortedResults);
|
||||||
|
}
|
||||||
|
return getGui().one(sa.getHostCard().getName() + " - Choose a result", sortedResults).equals(labelsSrc[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user