mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +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;
|
package forge.card;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import forge.util.IItemReader;
|
import forge.util.IItemReader;
|
||||||
import forge.util.storage.StorageView;
|
import forge.util.storage.StorageView;
|
||||||
@@ -55,6 +58,14 @@ public final class EditionCollection extends StorageView<CardEdition> {
|
|||||||
return baseResult == null ? aliasToEdition.get(code) : baseResult;
|
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.
|
* Gets the sets by code or throw.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ public enum FModel {
|
|||||||
FThreads.assertExecutedByEdt(false);
|
FThreads.assertExecutedByEdt(false);
|
||||||
final CardStorageReader reader = new CardStorageReader(NewConstants.CARD_DATA_DIR, true);
|
final CardStorageReader reader = new CardStorageReader(NewConstants.CARD_DATA_DIR, true);
|
||||||
// this fills in our map of card names to Card instances.
|
// 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");
|
this.formats = new FormatCollection("res/blockdata/formats.txt");
|
||||||
|
|||||||
Reference in New Issue
Block a user