mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
remove comparator, use Comparator.comparing
This commit is contained in:
parent
5736272dd6
commit
7344a15a9b
1 changed files with 3 additions and 8 deletions
|
@ -31,6 +31,8 @@ import java.util.ArrayList;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
|
@ -91,7 +93,7 @@ public class TargetCardInLibrary extends TargetCard {
|
|||
} else {
|
||||
cards = new ArrayList<>(targetPlayer.getLibrary().getTopCards(game, librarySearchLimit));
|
||||
}
|
||||
cards.sort(new CardNameComparator());
|
||||
cards.sort(Comparator.comparing(MageObject::getName));
|
||||
Cards cardsId = new CardsImpl();
|
||||
for (Card card : cards) {
|
||||
cardsId.add(card);
|
||||
|
@ -129,10 +131,3 @@ public class TargetCardInLibrary extends TargetCard {
|
|||
|
||||
}
|
||||
|
||||
class CardNameComparator implements Comparator<Card> {
|
||||
|
||||
@Override
|
||||
public int compare(Card o1, Card o2) {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue