mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
refactored getSetCodes to be used from ExpansionReposiitory
This commit is contained in:
parent
e2152c59a2
commit
0166975e83
5 changed files with 52 additions and 72 deletions
|
|
@ -4,10 +4,12 @@ import mage.constants.CardType;
|
|||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.Mana;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.decks.Deck;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.cards.repository.ExpansionRepository;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.util.gui.ColorsChooser;
|
||||
import mage.client.util.sets.ConstructedFormats;
|
||||
|
|
@ -28,8 +30,6 @@ import java.util.List;
|
|||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.cards.ExpansionSet;
|
||||
|
||||
/**
|
||||
* Generates random card pool and builds a deck.
|
||||
*
|
||||
|
|
@ -140,7 +140,7 @@ public class DeckGenerator {
|
|||
List<String> setsToUse = ConstructedFormats.getSetsByFormat(format);
|
||||
if (setsToUse.isEmpty()) {
|
||||
// use all
|
||||
setsToUse = CardRepository.instance.getSetCodes();
|
||||
setsToUse = ExpansionRepository.instance.getSetCodes();
|
||||
}
|
||||
|
||||
if (selectedColors.contains("X")) {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.cards.repository.ExpansionRepository;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.components.HoverButton;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
|
|
@ -301,7 +302,7 @@ public class MageBook extends JComponent {
|
|||
this.setsToDisplay = ConstructedFormats.getSetsByFormat(format);
|
||||
if (this.setsToDisplay.isEmpty()) {
|
||||
// display all
|
||||
this.setsToDisplay = CardRepository.instance.getSetCodes();
|
||||
this.setsToDisplay = ExpansionRepository.instance.getSetCodes();
|
||||
}
|
||||
addSetTabs();
|
||||
tabs.get(0).execute();
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@ import java.util.Arrays;
|
|||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.Sets;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.cards.repository.ExpansionInfo;
|
||||
import mage.cards.repository.ExpansionRepository;
|
||||
|
||||
/**
|
||||
* Utility class for constructed formats (expansions and other editions).
|
||||
|
|
@ -16,35 +15,36 @@ import mage.cards.repository.CardRepository;
|
|||
*/
|
||||
public class ConstructedFormats {
|
||||
|
||||
private static final String[] constructedFormats = {"- All Sets", "- Standard", "- Extended", "- Modern",
|
||||
"Modern Masters",
|
||||
"* Return to Ravnica Block", "Dragon's Maze", "Gatecrash","Return to Ravnica",
|
||||
"Magic 2013", "Planechase 2012",
|
||||
"* Innistrad Block", "Avacyn Restored", "Dark Ascension", "Innistrad",
|
||||
"Magic 2012", "Commander",
|
||||
"* Scars of Mirrodin Block", "New Phyrexia", "Mirrodin Besieged", "Scars of Mirrodin", "Magic 2011",
|
||||
"* Zendikar Block", "Rise of the Eldrazi", "Worldwake", "Zendikar",
|
||||
"Magic 2010", "Planechase",
|
||||
"* Shards of Alara Block", "Alara Reborn", "Conflux", "Shards of Alara",
|
||||
"* Shadowmoor Block", "Shadowmoor", "Eventide",
|
||||
"* Lorwyn Block", "Lorwyn", "Morningtide",
|
||||
"* Time Spiral Block", "Future Sight", "Planar Chaos", "Time Spiral", "Tenth Edition",
|
||||
"* Ravnica Block", "Dissension", "Guildpact", "Ravnica: City of Guilds",
|
||||
"* Kamigawa Block", "Saviors of Kamigawa", "Betrayers of Kamigawa", "Champions of Kamigawa","Ninth Edition",
|
||||
"* Mirrodin Block", "Fifth Dawn", "Darksteel", "Mirrodin",
|
||||
"* Onslaught Block", "Scourge", "Legions", "Onslaught","Eighth Edition",
|
||||
"* Odyssey Block", "Judgment", "Torment", "Odyssey",
|
||||
"* Invasion Block", "Apocalypse", "Planeshift", "Invasion","Seventh Edition",
|
||||
"* Masquerade Block", "Prophecy", "Nemesis", "Mercadian Masques",
|
||||
"* Urza Block", "Urza's Destiny", "Urza's Legacy", "Urza's Saga", "Sixth Edition",
|
||||
"* Tempest Block", "Exodus", "Stronghold", "Tempest",
|
||||
"* Mirage Block", "Weatherlight", "Visions", "Mirage", "Fifth Edition",
|
||||
"* Ice Age Block", "Coldsnap", "Alliances", "Ice Age", "Fourth Edition",
|
||||
"Homelands","Fallen Empires","The Dark","Legends","Antiquities", "Arabian Nights",
|
||||
"Revised Edition", "Unlimited Edition", "Limited Edition Beta", "Limited Edition Alpha",
|
||||
"Guru",
|
||||
"Duel Decks: Elspeth vs. Tezzeret"
|
||||
};
|
||||
private static final String[] constructedFormats = {
|
||||
"- All Sets", "- Standard", "- Extended", "- Modern",
|
||||
"Modern Masters",
|
||||
"* Return to Ravnica Block", "Dragon's Maze", "Gatecrash", "Return to Ravnica",
|
||||
"Magic 2013", "Planechase 2012",
|
||||
"* Innistrad Block", "Avacyn Restored", "Dark Ascension", "Innistrad",
|
||||
"Magic 2012", "Commander",
|
||||
"* Scars of Mirrodin Block", "New Phyrexia", "Mirrodin Besieged", "Scars of Mirrodin", "Magic 2011",
|
||||
"* Zendikar Block", "Rise of the Eldrazi", "Worldwake", "Zendikar",
|
||||
"Magic 2010", "Planechase",
|
||||
"* Shards of Alara Block", "Alara Reborn", "Conflux", "Shards of Alara",
|
||||
"* Shadowmoor Block", "Shadowmoor", "Eventide",
|
||||
"* Lorwyn Block", "Lorwyn", "Morningtide",
|
||||
"* Time Spiral Block", "Future Sight", "Planar Chaos", "Time Spiral", "Tenth Edition",
|
||||
"* Ravnica Block", "Dissension", "Guildpact", "Ravnica: City of Guilds",
|
||||
"* Kamigawa Block", "Saviors of Kamigawa", "Betrayers of Kamigawa", "Champions of Kamigawa", "Ninth Edition",
|
||||
"* Mirrodin Block", "Fifth Dawn", "Darksteel", "Mirrodin",
|
||||
"* Onslaught Block", "Scourge", "Legions", "Onslaught", "Eighth Edition",
|
||||
"* Odyssey Block", "Judgment", "Torment", "Odyssey",
|
||||
"* Invasion Block", "Apocalypse", "Planeshift", "Invasion", "Seventh Edition",
|
||||
"* Masquerade Block", "Prophecy", "Nemesis", "Mercadian Masques",
|
||||
"* Urza Block", "Urza's Destiny", "Urza's Legacy", "Urza's Saga", "Sixth Edition",
|
||||
"* Tempest Block", "Exodus", "Stronghold", "Tempest",
|
||||
"* Mirage Block", "Weatherlight", "Visions", "Mirage", "Fifth Edition",
|
||||
"* Ice Age Block", "Coldsnap", "Alliances", "Ice Age", "Fourth Edition",
|
||||
"Homelands", "Fallen Empires", "The Dark", "Legends", "Antiquities", "Arabian Nights",
|
||||
"Revised Edition", "Unlimited Edition", "Limited Edition Beta", "Limited Edition Alpha",
|
||||
"Guru",
|
||||
"Duel Decks: Elspeth vs. Tezzeret"
|
||||
};
|
||||
|
||||
private ConstructedFormats() {
|
||||
}
|
||||
|
|
@ -379,9 +379,7 @@ public class ConstructedFormats {
|
|||
}
|
||||
|
||||
private static void buildLists() {
|
||||
for (String setCode : CardRepository.instance.getSetCodes()) {
|
||||
ExpansionSet set = Sets.findSet(setCode);
|
||||
|
||||
for (ExpansionInfo set : ExpansionRepository.instance.getAll()) {
|
||||
if (set.getReleaseDate().after(standardDate)) {
|
||||
standard.add(set.getCode());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.mage.card.arcane;
|
||||
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.cards.repository.ExpansionRepository;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.gui.BufferedImageBuilder;
|
||||
|
|
@ -49,7 +50,7 @@ public class ManaSymbols {
|
|||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
List<String> setCodes = CardRepository.instance.getSetCodes();
|
||||
List<String> setCodes = ExpansionRepository.instance.getSetCodes();
|
||||
for (String set : setCodes) {
|
||||
File file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set + "-C.jpg");
|
||||
try {
|
||||
|
|
@ -106,7 +107,7 @@ public class ManaSymbols {
|
|||
}
|
||||
|
||||
File file;
|
||||
for (String set : CardRepository.instance.getSetCodes()) {
|
||||
for (String set : ExpansionRepository.instance.getSetCodes()) {
|
||||
file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL);
|
||||
if (!file.exists()) {
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue