Initial migration

This commit is contained in:
Anthony Calosa
2019-09-05 08:24:58 +08:00
parent 5876ee8220
commit 2b0e47dd14
28 changed files with 36 additions and 45 deletions

View File

@@ -27,7 +27,6 @@ import forge.util.ItemPoolSorter;
import forge.util.MyRandom;
import org.apache.commons.lang3.StringUtils;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
@@ -198,7 +197,7 @@ public class CardPool extends ItemPool<PaperCard> {
public String toCardList(String separator) {
List<Entry<PaperCard, Integer>> main2sort = Lists.newArrayList(this);
Collections.sort(main2sort, ItemPoolSorter.BY_NAME_THEN_SET);
main2sort.sort(ItemPoolSorter.BY_NAME_THEN_SET);
final CardDb commonDb = StaticData.instance().getCommonCards();
StringBuilder sb = new StringBuilder();

View File

@@ -123,7 +123,7 @@ public class Deck extends DeckBase implements Iterable<Entry<DeckSection, CardPo
result.add(c.getKey());
}
if (result.size() > 1) { //sort by type so signature spell comes after oathbreaker
Collections.sort(result, new Comparator<PaperCard>() {
result.sort(new Comparator<PaperCard>() {
@Override
public int compare(final PaperCard c1, final PaperCard c2) {
return Boolean.compare(c1.getRules().canBeSignatureSpell(), c2.getRules().canBeSignatureSpell());

View File

@@ -79,7 +79,7 @@ public class DeckGroup extends DeckBase {
if (aiDecks.size() < 2) {
return;
}
Collections.sort(aiDecks, comparator);
aiDecks.sort(comparator);
}
@Override

View File

@@ -518,7 +518,7 @@ public class FCollection<T> implements List<T>, /*Set<T>,*/ FCollectionView<T>,
* {@inheritDoc}
*/
public void sort(final Comparator<? super T> comparator) {
Collections.sort(list, comparator);
list.sort(comparator);
}
/**

View File

@@ -132,7 +132,7 @@ public final class MapToAmountUtil {
for (final Entry<T, Integer> entry : map.entrySet()) {
entries.add(Pair.of(entry.getKey(), entry.getValue()));
}
Collections.sort(entries, new Comparator<Entry<T, Integer>>() {
entries.sort(new Comparator<Entry<T, Integer>>() {
@Override
public int compare(final Entry<T, Integer> o1, final Entry<T, Integer> o2) {
return o1.getValue().compareTo(o2.getValue());