mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Style fixes for discussion.
(cherry picked from commit 3ae95447a2a91a36bd1772649592ef72ffb344f8)
This commit is contained in:
@@ -2218,8 +2218,7 @@ public class ComputerUtil {
|
|||||||
} else {
|
} else {
|
||||||
// TODO: This is just picking randomly amongst already picked things. It should probably pick the worst instead.
|
// TODO: This is just picking randomly amongst already picked things. It should probably pick the worst instead.
|
||||||
List<Object> a = Arrays.asList(votes.keySet().toArray());
|
List<Object> a = Arrays.asList(votes.keySet().toArray());
|
||||||
Collections.shuffle(a, MyRandom.getRandom());
|
return a.get(MyRandom.getRandom().nextInt(a.size()));
|
||||||
return a.get(0);
|
|
||||||
}
|
}
|
||||||
case "Protection":
|
case "Protection":
|
||||||
if (votes.isEmpty()) {
|
if (votes.isEmpty()) {
|
||||||
|
|||||||
@@ -135,7 +135,10 @@ public class ComputerUtilMana {
|
|||||||
@Override
|
@Override
|
||||||
public int compare(final Card card1, final Card card2) {
|
public int compare(final Card card1, final Card card2) {
|
||||||
int result = Integer.compare(manaCardMap.get(card1), manaCardMap.get(card2));
|
int result = Integer.compare(manaCardMap.get(card1), manaCardMap.get(card2));
|
||||||
return result != 0 ? result : Float.compare(card1.getTimestamp(), card2.getTimestamp());
|
if(result == 0) {
|
||||||
|
result = Float.compare(card1.getTimestamp(), card2.getTimestamp());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1006,7 +1009,7 @@ public class ComputerUtilMana {
|
|||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
private static String payMultipleMana(ManaCostBeingPaid testCost, String mana, final Player p) {
|
private static String payMultipleMana(ManaCostBeingPaid testCost, String mana, final Player p) {
|
||||||
List<String> unused = new ArrayList<String>(4);
|
List<String> unused = new ArrayList<>(4);
|
||||||
for (String manaPart : TextUtil.split(mana, ' ')) {
|
for (String manaPart : TextUtil.split(mana, ' ')) {
|
||||||
if (StringUtils.isNumeric(manaPart)) {
|
if (StringUtils.isNumeric(manaPart)) {
|
||||||
for (int i = Integer.parseInt(manaPart); i > 0; i--) {
|
for (int i = Integer.parseInt(manaPart); i > 0; i--) {
|
||||||
|
|||||||
Reference in New Issue
Block a user