mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
CardDb recieves editions in special order, and adds newest editions first. Thus the values of MapOfLists<String, PaperCard> allCardsByName are arranged - newest prints come first
This commit is contained in:
@@ -18,10 +18,13 @@
|
||||
package forge.card;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.util.IItemReader;
|
||||
import forge.util.storage.StorageView;
|
||||
@@ -54,6 +57,14 @@ public final class EditionCollection extends StorageView<CardEdition> {
|
||||
CardEdition baseResult = super.get(code);
|
||||
return baseResult == null ? aliasToEdition.get(code) : baseResult;
|
||||
}
|
||||
|
||||
|
||||
public Iterable<CardEdition> getOrderedEditions() {
|
||||
List<CardEdition> res = Lists.newArrayList(this);
|
||||
Collections.sort(res);
|
||||
Collections.reverse(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sets by code or throw.
|
||||
|
||||
@@ -146,7 +146,7 @@ public enum FModel {
|
||||
FThreads.assertExecutedByEdt(false);
|
||||
final CardStorageReader reader = new CardStorageReader(NewConstants.CARD_DATA_DIR, true);
|
||||
// this fills in our map of card names to Card instances.
|
||||
CardDb.setup(reader.loadCards(), editions);
|
||||
CardDb.setup(reader.loadCards(), editions.getOrderedEditions());
|
||||
|
||||
|
||||
this.formats = new FormatCollection("res/blockdata/formats.txt");
|
||||
|
||||
Reference in New Issue
Block a user