mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
refactor: use standard code style
This commit is contained in:
parent
b51fdae550
commit
86fc0028c1
9 changed files with 37 additions and 33 deletions
|
|
@ -50,7 +50,7 @@ public enum MultiAmountType {
|
|||
return res;
|
||||
}
|
||||
|
||||
int total = res.stream().reduce(0, Integer::sum);
|
||||
int total = res.stream().mapToInt(x -> x).sum();;
|
||||
|
||||
// Fill values until we reach the overall minimum. Do this by filling values up until either their max or however much is leftover, starting with the first option.
|
||||
if (min > 0 && total < min) {
|
||||
|
|
@ -85,7 +85,7 @@ public enum MultiAmountType {
|
|||
|
||||
// Total should fall between the sum of all of the minimum values and max (in the case that everything was filled with default_value).
|
||||
// So, we'll never start with too much.
|
||||
int total = res.stream().reduce(0, Integer::sum);
|
||||
int total = res.stream().mapToInt(x -> x).sum();
|
||||
|
||||
// So add some values evenly until we hit max
|
||||
while (total < max) {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class CastSpellLastTurnWatcher extends Watcher {
|
|||
}
|
||||
|
||||
public int getAmountOfSpellsAllPlayersCastOnCurrentTurn() {
|
||||
return amountOfSpellsCastOnCurrentTurn.values().stream().reduce(0, Integer::sum);
|
||||
return amountOfSpellsCastOnCurrentTurn.values().stream().mapToInt(x -> x).sum();
|
||||
}
|
||||
|
||||
public int getAmountOfSpellsPlayerCastOnCurrentTurn(UUID playerId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue