Updated format definition
Added erratasets field to format definitions. Sets may now be added as errata sets, which will load their entire library as an errata for that format. This assumes that all card numbers are the same between errata and non-errata. Altered all PC definitions to account for this new functionality.
This commit is contained in:
@@ -24,16 +24,9 @@
|
||||
"sites":"FELLOWSHIP",
|
||||
"cancelRingBearerSkirmish":true,
|
||||
"set":[1, 2, 3, 101],
|
||||
"errata":{
|
||||
"1_7":"51_7", "1_11":"51_11", "1_12":"51_12", "1_40":"51_40", "1_45":"51_45",
|
||||
"1_53":"51_53", "1_55":"51_55", "1_80":"51_80", "1_108":"51_108", "1_138":"51_138",
|
||||
"1_139":"51_139", "1_195":"51_195", "1_234":"51_234", "1_248":"51_248", "1_254":"51_254",
|
||||
"1_282":"51_282", "1_311":"51_311", "1_313":"51_313", "1_316":"51_316",
|
||||
"2_6":"52_6", "2_7":"52_7", "2_32":"52_32", "2_75":"52_75", "2_101":"52_101", "2_108":"52_108",
|
||||
"2_121":"52_121",
|
||||
"3_17":"53_17", "3_38":"53_38", "3_42":"53_42", "3_67":"53_67", "3_68":"53_68", "3_106":"53_106",
|
||||
"3_108":"53_108", "3_113":"53_113", "3_120":"53_120"
|
||||
}
|
||||
"erratasets": [
|
||||
51,52,53
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"Movie Block",
|
||||
@@ -49,20 +42,9 @@
|
||||
"order": 4,
|
||||
"sites":"KING",
|
||||
"set":[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101],
|
||||
"errata":{
|
||||
"1_7":"51_7", "1_11":"51_11", "1_12":"51_12", "1_40":"51_40", "1_45":"51_45",
|
||||
"1_53":"51_53", "1_55":"51_55", "1_80":"51_80", "1_108":"51_108", "1_138":"51_138",
|
||||
"1_139":"51_139", "1_195":"51_195", "1_234":"51_234", "1_248":"51_248", "1_254":"51_254",
|
||||
"1_282":"51_282", "1_311":"51_311", "1_313":"51_313", "1_316":"51_316",
|
||||
"2_6":"52_6", "2_7":"52_7", "2_32":"52_32", "2_75":"52_75", "2_101":"52_101", "2_108":"52_108",
|
||||
"2_121":"52_121",
|
||||
"3_17":"53_17", "3_38":"53_38", "3_42":"53_42", "3_67":"53_67", "3_68":"53_68", "3_106":"53_106",
|
||||
"3_108":"53_108", "3_113":"53_113", "3_120":"53_120",
|
||||
"4_73":"54_73", "4_192":"54_192", "4_276":"54_276", "4_304":"54_304",
|
||||
"7_49":"57_49", "7_96":"57_96", "7_359":"57_359",
|
||||
"8_1":"58_1", "8_24":"58_24", "8_51":"58_51", "8_57":"58_57", "8_59":"58_59", "8_102":"58_102", "8_103":"58_103",
|
||||
"10_2":"60_2", "10_8":"60_8", "10_11":"60_11", "10_17":"60_17", "10_91":"60_91"
|
||||
}
|
||||
"erratasets": [
|
||||
51,52,53,54,55,56,57,58,59,60
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"Expanded",
|
||||
@@ -79,25 +61,9 @@
|
||||
"order": 6,
|
||||
"sites":"SHADOWS",
|
||||
"set":[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 101],
|
||||
"errata":{
|
||||
"1_7":"51_7", "1_11":"51_11", "1_12":"51_12", "1_40":"51_40", "1_45":"51_45",
|
||||
"1_53":"51_53", "1_55":"51_55", "1_80":"51_80", "1_108":"51_108", "1_138":"51_138",
|
||||
"1_139":"51_139", "1_195":"51_195", "1_234":"51_234", "1_248":"51_248", "1_254":"51_254",
|
||||
"1_282":"51_282", "1_311":"51_311", "1_313":"51_313", "1_316":"51_316",
|
||||
"2_6":"52_6", "2_7":"52_7", "2_32":"52_32", "2_75":"52_75", "2_101":"52_101", "2_108":"52_108",
|
||||
"2_121":"52_121",
|
||||
"3_17":"53_17", "3_38":"53_38", "3_42":"53_42", "3_67":"53_67", "3_68":"53_68", "3_106":"53_106",
|
||||
"3_108":"53_108", "3_113":"53_113", "3_120":"53_120",
|
||||
"4_73":"54_73", "4_192":"54_192", "4_276":"54_276", "4_304":"54_304",
|
||||
"7_49":"57_49", "7_96":"57_96", "7_359":"57_359",
|
||||
"8_1":"58_1", "8_24":"58_24", "8_51":"58_51", "8_57":"58_57", "8_59":"58_59", "8_102":"58_102", "8_103":"58_103",
|
||||
"10_2":"60_2", "10_8":"60_8", "10_11":"60_11", "10_17":"60_17", "10_91":"60_91",
|
||||
|
||||
"11_31":"61_31", "11_100":"61_100", "11_114":"61_114", "11_132":"61_132", "13_188":"63_188",
|
||||
"15_15":"65_15", "15_62":"65_62", "15_64":"65_64", "15_112": "65_112",
|
||||
"18_12":"68_12", "18_29":"68_29", "18_50":"68_50", "18_79":"68_79", "18_96":"68_96", "18_112":"68_112",
|
||||
"19_38":"69_38"
|
||||
}
|
||||
"erratasets": [
|
||||
51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"Fellowship Block - Set 1",
|
||||
@@ -426,16 +392,10 @@
|
||||
"hall":true,
|
||||
"playtest":true,
|
||||
"set":[1, 2, 3, 101, 151],
|
||||
"errata":{
|
||||
"1_7":"51_7", "1_11":"51_11", "1_12":"51_12", "1_40":"51_40", "1_45":"51_45",
|
||||
"1_53":"51_53", "1_55":"51_55", "1_80":"51_80", "1_108":"51_108", "1_138":"51_138",
|
||||
"1_139":"51_139", "1_195":"51_195", "1_234":"51_234", "1_248":"51_248", "1_254":"51_254",
|
||||
"1_282":"51_282", "1_311":"51_311", "1_313":"51_313", "1_316":"51_316",
|
||||
"2_6":"52_6", "2_7":"52_7", "2_32":"52_32", "2_75":"52_75", "2_101":"52_101", "2_108":"52_108",
|
||||
"2_121":"52_121",
|
||||
"3_17":"53_17", "3_38":"53_38", "3_42":"53_42", "3_67":"53_67", "3_68":"53_68", "3_106":"53_106",
|
||||
"3_108":"53_108", "3_113":"53_113", "3_120":"53_120"
|
||||
}
|
||||
"erratasets": [
|
||||
51,52,53,
|
||||
71,72,73
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"PLAYTEST - Movie Block (PC)",
|
||||
@@ -445,20 +405,10 @@
|
||||
"hall":true,
|
||||
"playtest":true,
|
||||
"set":[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101, 151],
|
||||
"errata":{
|
||||
"1_7":"51_7", "1_11":"51_11", "1_12":"51_12", "1_40":"51_40", "1_45":"51_45",
|
||||
"1_53":"51_53", "1_55":"51_55", "1_80":"51_80", "1_108":"51_108", "1_138":"51_138",
|
||||
"1_139":"51_139", "1_195":"51_195", "1_234":"51_234", "1_248":"51_248", "1_254":"51_254",
|
||||
"1_282":"51_282", "1_311":"51_311", "1_313":"51_313", "1_316":"51_316",
|
||||
"2_6":"52_6", "2_7":"52_7", "2_32":"52_32", "2_75":"52_75", "2_101":"52_101", "2_108":"52_108",
|
||||
"2_121":"52_121",
|
||||
"3_17":"53_17", "3_38":"53_38", "3_42":"53_42", "3_67":"53_67", "3_68":"53_68", "3_106":"53_106",
|
||||
"3_108":"53_108", "3_113":"53_113", "3_120":"53_120",
|
||||
"4_73":"54_73", "4_192":"54_192", "4_276":"54_276", "4_304":"54_304",
|
||||
"7_49":"57_49", "7_96":"57_96", "7_359":"57_359",
|
||||
"8_1":"58_1", "8_24":"58_24", "8_51":"58_51", "8_57":"58_57", "8_59":"58_59", "8_102":"58_102", "8_103":"58_103",
|
||||
"10_2":"60_2", "10_8":"60_8", "10_11":"60_11", "10_17":"60_17", "10_91":"60_91"
|
||||
}
|
||||
"erratasets": [
|
||||
51,52,53,54,55,56,57,58,59,60,
|
||||
71,72,73,74,75,76,77,78,79,80
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"PLAYTEST - Expanded (PC)",
|
||||
@@ -468,25 +418,10 @@
|
||||
"hall":true,
|
||||
"playtest":true,
|
||||
"set":[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 101, 151],
|
||||
"errata":{
|
||||
"1_7":"51_7", "1_11":"51_11", "1_12":"51_12", "1_40":"51_40", "1_45":"51_45",
|
||||
"1_53":"51_53", "1_55":"51_55", "1_80":"51_80", "1_108":"51_108", "1_138":"51_138",
|
||||
"1_139":"51_139", "1_195":"51_195", "1_234":"51_234", "1_248":"51_248", "1_254":"51_254",
|
||||
"1_282":"51_282", "1_311":"51_311", "1_313":"51_313", "1_316":"51_316",
|
||||
"2_6":"52_6", "2_7":"52_7", "2_32":"52_32", "2_75":"52_75", "2_101":"52_101", "2_108":"52_108",
|
||||
"2_121":"52_121",
|
||||
"3_17":"53_17", "3_38":"53_38", "3_42":"53_42", "3_67":"53_67", "3_68":"53_68", "3_106":"53_106",
|
||||
"3_108":"53_108", "3_113":"53_113", "3_120":"53_120",
|
||||
"4_73":"54_73", "4_192":"54_192", "4_276":"54_276", "4_304":"54_304",
|
||||
"7_49":"57_49", "7_96":"57_96", "7_359":"57_359",
|
||||
"8_1":"58_1", "8_24":"58_24", "8_51":"58_51", "8_57":"58_57", "8_59":"58_59", "8_102":"58_102", "8_103":"58_103",
|
||||
"10_2":"60_2", "10_8":"60_8", "10_11":"60_11", "10_17":"60_17", "10_91":"60_91",
|
||||
|
||||
"11_31":"61_31", "11_100":"61_100", "11_114":"61_114", "11_132":"61_132", "13_188":"63_188",
|
||||
"15_15":"65_15", "15_62":"65_62", "15_64":"65_64", "15_112": "65_112",
|
||||
"18_12":"68_12", "18_29":"68_29", "18_50":"68_50", "18_79":"68_79", "18_96":"68_96", "18_112":"68_112",
|
||||
"19_38":"69_38"
|
||||
}
|
||||
"erratasets": [
|
||||
51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,
|
||||
71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"Fellowship Block - Poorman's",
|
||||
|
||||
@@ -53,6 +53,7 @@ public class JSONDefs {
|
||||
public ArrayList<String> limit2 = new ArrayList<>();
|
||||
public ArrayList<String> limit3 = new ArrayList<>();
|
||||
public ArrayList<String> restrictedName = new ArrayList<>();
|
||||
public ArrayList<Integer> errataSets = new ArrayList<>();
|
||||
public Map<String, String> errata = new HashMap<>();
|
||||
public boolean hall = true;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DefaultLotroFormat implements LotroFormat {
|
||||
private final List<String> _limit3Cards = new ArrayList<>();
|
||||
private final Map<String,String> _errataCardMap = new TreeMap<>();
|
||||
|
||||
public DefaultLotroFormat(AdventureLibrary adventureLibrary, LotroCardBlueprintLibrary library, JSONDefs.Format def){
|
||||
public DefaultLotroFormat(AdventureLibrary adventureLibrary, LotroCardBlueprintLibrary library, JSONDefs.Format def) throws InvalidPropertiesFormatException{
|
||||
this(library, adventureLibrary.getAdventure(def.adventure), def.name, def.code, def.order, def.surveyUrl, SitesBlock.valueOf(def.sites),
|
||||
def.validateShadowFPCount, def.minimumDeckSize, def.maximumSameName, def.mulliganRule, def.cancelRingBearerSkirmish,
|
||||
def.ruleOfFour, def.winAtEndOfRegroup, def.winOnControlling5Sites, def.playtest, def.hall);
|
||||
@@ -58,6 +58,11 @@ public class DefaultLotroFormat implements LotroFormat {
|
||||
def.limit3.forEach(this::addLimit3Card);
|
||||
if(def.restrictedName != null)
|
||||
def.restrictedName.forEach(this::addRestrictedCardName);
|
||||
if(def.errataSets != null) {
|
||||
for (Integer errataSet : def.errataSets) {
|
||||
addErrataSet(errataSet);
|
||||
}
|
||||
}
|
||||
if(def.errata != null)
|
||||
def.errata.forEach(this::addCardErrata);
|
||||
}
|
||||
@@ -253,6 +258,27 @@ public class DefaultLotroFormat implements LotroFormat {
|
||||
_restrictedCardNames.add(cardName);
|
||||
}
|
||||
|
||||
public void addErrataSet(int setID) throws InvalidPropertiesFormatException {
|
||||
//Valid errata sets:
|
||||
// 50-69 are live errata versions of sets 0-19
|
||||
// 70-89 are playtest errata versions of sets 0-19
|
||||
// 150-199 are playtest versions of sets V0-V49
|
||||
if(setID < 50 || (setID >= 90 && setID <= 149) || setID > 199)
|
||||
throw new InvalidPropertiesFormatException("Errata sets must be 50-69, 70-89, or 150-159. Received: " + setID);
|
||||
|
||||
//maps 69 to 19, and also 151 to 101
|
||||
int ogSet = setID - 50;
|
||||
//playtest sets are offset by 20 more
|
||||
if(setID >= 70 && setID <=89)
|
||||
ogSet = setID - 70;
|
||||
|
||||
var cards = _library.getBaseCards().keySet().stream().filter(x -> x.startsWith("" + setID)).toList();
|
||||
for(String errataBP : cards) {
|
||||
String cardID = errataBP.split("_")[1];
|
||||
|
||||
addCardErrata("" + ogSet + "_" + cardID, errataBP);
|
||||
}
|
||||
}
|
||||
public void addCardErrata(String baseBlueprintId, String errataBaseBlueprint) {
|
||||
_errataCardMap.put(baseBlueprintId, errataBaseBlueprint);
|
||||
}
|
||||
@@ -681,6 +707,7 @@ public class DefaultLotroFormat implements LotroFormat {
|
||||
limit2 = null;
|
||||
limit3 = null;
|
||||
restrictedName = null;
|
||||
errataSets = null;
|
||||
errata = null;
|
||||
hall = _hallVisible;
|
||||
}};
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.gempukku.lotro.game.formats;
|
||||
|
||||
import com.gempukku.lotro.game.DefaultAdventureLibrary;
|
||||
import com.gempukku.lotro.game.LotroCardBlueprintLibrary;
|
||||
import org.junit.Test;
|
||||
|
||||
public class LotroFormatLibraryTest {
|
||||
@Test
|
||||
public void testLoad() {
|
||||
LotroFormatLibrary library = new LotroFormatLibrary(new DefaultAdventureLibrary(), null);
|
||||
LotroFormatLibrary library = new LotroFormatLibrary(new DefaultAdventureLibrary(), new LotroCardBlueprintLibrary());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user