forked from External/mage
loop to streams
This commit is contained in:
parent
d42b2a6d37
commit
0cb7d8aab6
4 changed files with 67 additions and 90 deletions
|
|
@ -27,13 +27,15 @@
|
|||
*/
|
||||
package mage.choices;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mage.abilities.Ability;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -57,13 +59,9 @@ public class Choices extends ArrayList<Choice> {
|
|||
}
|
||||
|
||||
public List<Choice> getUnchosen() {
|
||||
List<Choice> unchosen = new ArrayList<>();
|
||||
for (Choice choice : this) {
|
||||
if (!choice.isChosen()) {
|
||||
unchosen.add(choice);
|
||||
}
|
||||
}
|
||||
return unchosen;
|
||||
return stream()
|
||||
.filter(choice -> !choice.isChosen())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public void clearChosen() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue