From 783a278fca5f7011229c20ad321231553e1e34d3 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Tue, 27 Sep 2016 01:54:49 -0500 Subject: [PATCH] Added Frontier format (M15 forward). Added Kaladesh block constructed. --- .../java/mage/client/table/TablesPanel.java | 6 +- .../client/util/sets/ConstructedFormats.java | 11 +++- .../src/mage/deck/Frontier.java | 57 +++++++++++++++++++ .../src/mage/deck/KaladeshBlock.java | 44 ++++++++++++++ Mage.Server/config/config.xml | 2 + Mage.Server/release/config/config.xml | 2 + 6 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Frontier.java create mode 100644 Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/KaladeshBlock.java diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java index b0df188e1a..93344a81b7 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java @@ -602,7 +602,7 @@ public class TablesPanel extends javax.swing.JPanel { formatFilterList.add(RowFilter.regexFilter("^Limited", TableTableModel.COLUMN_DECK_TYPE)); } if (btnFormatOther.isSelected()) { - formatFilterList.add(RowFilter.regexFilter("^Momir Basic|^Constructed - Pauper|^Constructed - Extended|^Constructed - Historical|^Constructed - Super|^Freeform", TableTableModel.COLUMN_DECK_TYPE)); + formatFilterList.add(RowFilter.regexFilter("^Momir Basic|^Constructed - Pauper|^Constructed - Frontier|^Constructed - Extended|^Constructed - Historical|^Constructed - Super|^Freeform", TableTableModel.COLUMN_DECK_TYPE)); } List> skillFilterList = new ArrayList<>(); @@ -623,7 +623,7 @@ public class TablesPanel extends javax.swing.JPanel { if (btnUnrated.isSelected()){ ratingFilterList.add(RowFilter.regexFilter("^Unrated", TableTableModel.COLUMN_RATING)); } - + // Password List> passwordFilterList = new ArrayList<>(); if (btnOpen.isSelected()) { @@ -669,7 +669,7 @@ public class TablesPanel extends javax.swing.JPanel { } else if (ratingFilterList.size() == 1) { filterList.addAll(ratingFilterList); } - + if (passwordFilterList.size() > 1) { filterList.add(RowFilter.orFilter(passwordFilterList)); } else if (passwordFilterList.size() == 1) { diff --git a/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java b/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java index dc2e405921..66a3358220 100644 --- a/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java +++ b/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java @@ -8,7 +8,6 @@ import java.util.GregorianCalendar; import java.util.HashMap; import java.util.List; import java.util.Map; - import mage.cards.repository.ExpansionInfo; import mage.cards.repository.ExpansionRepository; import mage.constants.SetType; @@ -27,6 +26,7 @@ public class ConstructedFormats { public static final String ALL = "- All Sets"; public static final String STANDARD = "- Standard"; public static final String EXTENDED = "- Extended"; + public static final String FRONTIER = "- Frontier"; public static final String MODERN = "- Modern"; public static final Standard STANDARD_CARDS = new Standard(); @@ -77,6 +77,12 @@ public class ConstructedFormats { } underlyingSetCodesPerFormat.get(EXTENDED).add(set.getCode()); } + if (set.getReleaseDate().after(frontierDate)) { + if(underlyingSetCodesPerFormat.get(FRONTIER) == null) { + underlyingSetCodesPerFormat.put(FRONTIER, new ArrayList()); + } + underlyingSetCodesPerFormat.get(FRONTIER).add(set.getCode()); + } if (set.getReleaseDate().after(modernDate)) { if(underlyingSetCodesPerFormat.get(MODERN) == null) { underlyingSetCodesPerFormat.put(MODERN, new ArrayList()); @@ -210,6 +216,7 @@ public class ConstructedFormats { }); if (!formats.isEmpty()) { formats.add(0, MODERN); + formats.add(0, FRONTIER); formats.add(0, EXTENDED); formats.add(0, STANDARD); } @@ -225,7 +232,7 @@ public class ConstructedFormats { private static final Date extendedDate = new GregorianCalendar(2009, 8, 20).getTime(); - + private static final Date frontierDate = new GregorianCalendar(2014, 7, 17).getTime(); private static final Date modernDate = new GregorianCalendar(2003, 7, 20).getTime(); // for all sets just return empty list diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Frontier.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Frontier.java new file mode 100644 index 0000000000..4c04953bb9 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Frontier.java @@ -0,0 +1,57 @@ +/* +* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. + */ +package mage.deck; + +import java.util.Date; +import java.util.GregorianCalendar; +import mage.cards.ExpansionSet; +import mage.cards.Sets; +import mage.cards.decks.Constructed; +import mage.constants.SetType; + +/** + * + * @author fireshoes + */ +public class Frontier extends Constructed { + + public Frontier() { + super("Constructed - Frontier"); + + Date cutoff = new GregorianCalendar(2014, 7, 18).getTime(); // M15 release date + for (ExpansionSet set : Sets.getInstance().values()) { + if ((set.getReleaseDate().after(cutoff) || set.getReleaseDate().equals(cutoff)) + && (set.getSetType() == SetType.CORE || set.getSetType() == SetType.EXPANSION)) { + setCodes.add(set.getCode()); + } + } + + // Future banlist + // banned.add(""); + } +} diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/KaladeshBlock.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/KaladeshBlock.java new file mode 100644 index 0000000000..1bc4bfb963 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/KaladeshBlock.java @@ -0,0 +1,44 @@ +/* +* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.deck; + +import mage.cards.decks.Constructed; + +/** + * + * @author fireshoes + */ +public class KaladeshBlock extends Constructed { + + public KaladeshBlock() { + super("Constructed - Kaladesh Block"); + setCodes.add("KLD"); + setCodes.add("AER"); + } +} diff --git a/Mage.Server/config/config.xml b/Mage.Server/config/config.xml index 74a28df7ac..3f8f90557b 100644 --- a/Mage.Server/config/config.xml +++ b/Mage.Server/config/config.xml @@ -117,6 +117,7 @@ + @@ -131,6 +132,7 @@ + diff --git a/Mage.Server/release/config/config.xml b/Mage.Server/release/config/config.xml index 99c5047d52..c74c4e85d2 100644 --- a/Mage.Server/release/config/config.xml +++ b/Mage.Server/release/config/config.xml @@ -114,6 +114,7 @@ + @@ -128,6 +129,7 @@ +