diff --git a/dbconverter/src/main.h b/dbconverter/src/main.h index 4476161b5..d6e734316 100644 --- a/dbconverter/src/main.h +++ b/dbconverter/src/main.h @@ -5,6 +5,10 @@ #include #include +static const QList kConstructedCounts = {{4, "legal"}, {0, "banned"}}; + +static const QList kSingletonCounts = {{1, "legal"}, {0, "banned"}}; + class CardDatabaseConverter : public CardDatabase { public: @@ -41,7 +45,7 @@ public: CardCondition anyNumberAllowed; anyNumberAllowed.field = "text"; anyNumberAllowed.matchType = "contains"; - anyNumberAllowed.value = "may contain any number of"; + anyNumberAllowed.value = "A deck can have any number of"; ExceptionRule mayContainAnyNumber; mayContainAnyNumber.conditions.append(anyNumberAllowed); @@ -50,11 +54,11 @@ public: FormatRulesNameMap defaultFormatRulesNameMap; // ----------------- Helper lambda to create format ----------------- - auto makeFormat = [&](const QString &name, int maxCopies = 4, int minDeck = 60, int maxDeck = -1, - int maxSideboardSize = 15) -> FormatRulesPtr { + auto makeFormat = [&](const QString &name, int minDeck = 60, int maxDeck = -1, int maxSideboardSize = 15, + const QList &allowedCounts = kConstructedCounts) -> FormatRulesPtr { FormatRulesPtr f(new FormatRules); f->formatName = name; - f->maxCopies = maxCopies; + f->allowedCounts = allowedCounts; f->minDeckSize = minDeck; f->maxDeckSize = maxDeck; f->maxSideboardSize = maxSideboardSize; @@ -65,27 +69,29 @@ public: }; // ----------------- Standard formats ----------------- - makeFormat("Alchemy", 4, 60); - makeFormat("Brawl", 1, 60, 60); - makeFormat("Commander", 1, 100, 100); - makeFormat("Duel", 1, 100, 100); - makeFormat("Future"); - makeFormat("Gladiator", 4, 60, 60, 0); - makeFormat("Historic"); - makeFormat("Legacy"); - makeFormat("Modern"); - makeFormat("Oathbreaker", 1, 60, 60); - makeFormat("OldSchool"); - makeFormat("Pauper"); - makeFormat("PauperCommander", 1, 100, 100); - makeFormat("Penny"); - makeFormat("Pioneer"); - makeFormat("Predh", 1, 100, 100); - makeFormat("Premodern"); makeFormat("Standard"); - makeFormat("StandardBrawl", 1, 60, 60); + makeFormat("Modern"); + makeFormat("Legacy"); + makeFormat("Pioneer"); + makeFormat("Historic"); makeFormat("Timeless"); - makeFormat("Vintage"); + makeFormat("Future"); + makeFormat("OldSchool"); + makeFormat("Premodern"); + makeFormat("Pauper"); + makeFormat("Penny"); + + // ----------------- Singleton formats ----------------- + makeFormat("Commander", 100, 100, 15, kSingletonCounts); + makeFormat("Duel", 100, 100, 15, kSingletonCounts); + makeFormat("Brawl", 60, 60, 15, kSingletonCounts); + makeFormat("StandardBrawl", 60, 60, 15, kSingletonCounts); + makeFormat("Oathbreaker", 60, 60, 15, kSingletonCounts); + makeFormat("PauperCommander", 100, 100, 15, kSingletonCounts); + makeFormat("Predh", 100, 100, 15, kSingletonCounts); + + // ----------------- Restricted formats ----------------- + makeFormat("Vintage", 60, -1, 15, {{4, "legal"}, {1, "restricted"}, {0, "banned"}}); return defaultFormatRulesNameMap; }