- When getting all formats of a deck, don't change the order of the formats but sticking it into an unordered set.

This commit is contained in:
Sol
2016-09-19 03:35:28 +00:00
parent 5e4385b9e1
commit ef570f450d

View File

@@ -35,13 +35,8 @@ import forge.util.storage.StorageBase;
import forge.util.storage.StorageReaderFileSections; import forge.util.storage.StorageReaderFileSections;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set;
public class GameFormat implements Comparable<GameFormat> { public class GameFormat implements Comparable<GameFormat> {
@@ -273,7 +268,7 @@ public class GameFormat implements Comparable<GameFormat> {
} }
public Set<GameFormat> getAllFormatsOfDeck(Deck deck) { public Set<GameFormat> getAllFormatsOfDeck(Deck deck) {
Set<GameFormat> result = new HashSet<GameFormat>(); SortedSet<GameFormat> result = new TreeSet<GameFormat>();
CardPool allCards = deck.getAllCardsInASinglePool(); CardPool allCards = deck.getAllCardsInASinglePool();
for(GameFormat gf : naturallyOrdered) { for(GameFormat gf : naturallyOrdered) {
if (gf.isPoolLegal(allCards)) { if (gf.isPoolLegal(allCards)) {