From 0d3d9b568f86ef9bd532db2cb778aeb185b8df75 Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Thu, 6 Jul 2023 03:04:32 -0500 Subject: [PATCH] HJSON conversion cleanup - Altered format and set definition files to be true hjson files. - Altered the loading of set and format definitions to conform with existing POJO-based deserialization - Replaced a lot of stupid "has flag" string-based field lookup that could just be a field on the set definition - Seems to compile and run, but there's a possibility I missed something and changes here depend on as-yet unchecked-in code to soon follow --- .../src/main/java/CreateCardStubs.java | 2 +- .../src/main/resources/lotrFormats.hjson | 1288 ++++++++++------- .../src/main/resources/setConfig.hjson | 700 ++++----- .../com/gempukku/lotro/common/JSONDefs.java | 10 + .../lotro/game/LotroCardBlueprintLibrary.java | 60 +- .../game/packs/DefaultSetDefinition.java | 35 +- .../lotro/game/packs/SetDefinition.java | 5 +- .../game/formats/LotroFormatLibrary.java | 10 +- .../lotro/league/FixedLeaguePrizes.java | 2 +- .../lotro/merchant/MerchantService.java | 2 +- .../lotro/merchant/RarityBasedMerchant.java | 2 +- .../lotro/merchant/StorageBasedMerchant.java | 2 +- .../tournament/DailyTournamentPrizes.java | 2 +- .../SingleEliminationOnDemandPrizes.java | 2 +- 14 files changed, 1168 insertions(+), 954 deletions(-) diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/CreateCardStubs.java b/gemp-lotr/gemp-lotr-cards/src/main/java/CreateCardStubs.java index 43969892c..03d559022 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/CreateCardStubs.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/CreateCardStubs.java @@ -43,7 +43,7 @@ public class CreateCardStubs { Map> cardsByFileName = new HashMap<>(); SetDefinition setDefinition = library.getSetDefinitions().get("" + set); - if (setDefinition.hasFlag("needsLoading")) { + if (setDefinition.NeedsLoading()) { final Set allCards = setDefinition.getAllCards(); for (String blueprintId : allCards) { blueprintId = stripBlueprintModifiers(blueprintId); diff --git a/gemp-lotr/gemp-lotr-cards/src/main/resources/lotrFormats.hjson b/gemp-lotr/gemp-lotr-cards/src/main/resources/lotrFormats.hjson index b7eed003a..7bece3b78 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/resources/lotrFormats.hjson +++ b/gemp-lotr/gemp-lotr-cards/src/main/resources/lotrFormats.hjson @@ -1,542 +1,752 @@ [ - { - name:"Debug", - code:"debug", - sites: "SPECIAL", - maximumSameName:100, - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 101, 151, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 200], - hall:false - } - { - name:"Fellowship Block", - code:"fotr_block", - order: 1, - sites:"FELLOWSHIP", - cancelRingBearerSkirmish:true, - set:[1, 2, 3] - } - { - name:"Fellowship Block (PC)", - code:"pc_fotr_block", - order: 2, - sites:"FELLOWSHIP", - cancelRingBearerSkirmish:true, - winAtEndOfRegroup:true, - "discardPileIsPublic":true, - set:[1, 2, 3, 101], - erratasets: [ - 51,52,53 - ] - } - { - name:"Movie Block", - code:"movie", - order: 3, - sites:"KING", - banned:["8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", "7_49", "1_313", "1_234"], - set:[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - } - { - name:"Movie Block (PC)", - code:"pc_movie", - order: 4, - sites:"KING", - winAtEndOfRegroup:true, - "discardPileIsPublic":true, - set:[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101], - erratasets: [ - 51,52,53,54,55,56,57,58,59,60 - ] - } - { - name:"Expanded", - code:"expanded", - order: 5, - sites:"SHADOWS", - banned:["1_45", "1_138", "1_234", "1_311", "1_313", "1_316", "2_121", "3_17", "3_38", "3_42", "3_67", "3_68", "3_108", "3_113", "4_73", "7_49", "8_1", "10_2", "10_11", "10_91", "11_31", "11_100", "11_132"], - "restricted":["1_40", "1_80", "1_108", "1_139", "1_195", "1_248", "2_32", "2_75", "3_106", "4_276", "4_304"], - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] - } - { - name:"Expanded (PC)", - code:"pc_expanded", - order: 6, - sites:"SHADOWS", - winAtEndOfRegroup:true, - "discardPileIsPublic":true, - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 100, 101], - 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", - code:"fotr1_block", - order: 7, - sites:"FELLOWSHIP", - cancelRingBearerSkirmish:true, - set:[1], - hall:false - } - { - name:"Fellowship Block - Sets 1-2", - code:"fotr2_block", - order: 8, - sites:"FELLOWSHIP", - cancelRingBearerSkirmish:true, - set:[1, 2], - hall:false - } - { - name:"Towers Block", - code:"ttt_block", - order: 9, - sites:"TWO_TOWERS", - cancelRingBearerSkirmish:true, - set:[4, 5, 6] - } - { - name:"Towers Open - Sets 1-4", - code:"open_legacy", - order: 10, - sites:"TWO_TOWERS", - cancelRingBearerSkirmish:true, - set:[1, 2, 3, 4], - hall:false - } - { - name:"Towers Block - Set 4", - code:"ttt1_block", - order: 11, - sites:"TWO_TOWERS", - cancelRingBearerSkirmish:true, - set:[4], - hall:false - } - { - name:"Towers Block - Sets 4-5", - code:"ttt2_block", - order: 12, - sites:"TWO_TOWERS", - cancelRingBearerSkirmish:true, - set:[4, 5], - hall:false - } - - { - name:"Towers Standard", - code:"towers_standard", - order: 13, - sites:"TWO_TOWERS", - cancelRingBearerSkirmish:true, - banned:["1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32", "2_101", "2_108", "3_38", "3_42", "3_68", "4_192"], - set:[1, 2, 3, 4, 5, 6] - } - { - name:"Towers Standard - Sets 1-4", - code:"ttt_standard", - order: 14, - sites:"TWO_TOWERS", - cancelRingBearerSkirmish:true, - banned:["1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32", "2_101", "2_108", "3_38", "3_42", "3_68", "4_192"], - set:[1, 2, 3, 4], - hall:false - } - { - name:"Towers Standard - Sets 1-5", - code:"bohd_standard", - order: 15, - sites:"TWO_TOWERS", - cancelRingBearerSkirmish:true, - banned:["1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32", "2_101", "2_108", "3_38", "3_42", "3_68", "4_192"], - set:[1, 2, 3, 4, 5], - hall:false - } - { - name:"Towers Standard - Sets 2-6", - code:"ts_no_fotr", - order: 16, - sites:"TWO_TOWERS", - cancelRingBearerSkirmish:true, - banned:["1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32", "2_101", "2_108", "3_38", "3_42", "3_68", "4_192"], - set:[2, 3, 4, 5, 6], - hall:false - } - { - name:"Enhanced Towers Standard", - code:"ts_reflections", - order: 17, - sites:"TWO_TOWERS", - cancelRingBearerSkirmish:false, - banned:["1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32", "2_101", "2_108", "3_38", "3_42", "3_68", "4_192"], - set:[1, 2, 3, 4, 5, 6, 9, 14, 16], - hall:true - } - { - name:"King Block", - code:"king_block", - order: 18, - sites:"KING", - cancelRingBearerSkirmish:true, - "restricted":["7_49"], - set:[7, 8, 10] - } - { - name:"King Block - Set 7", - code:"king1_block", - order: 19, - sites:"KING", - cancelRingBearerSkirmish:true, - "restricted":["7_49"], - set:[7], - hall:false - } - { - name:"King Block - Sets 7-8", - code:"king2_block", - order: 20, - sites:"KING", - cancelRingBearerSkirmish:true, - "restricted":["7_49"], - set:[7, 8], - hall:false - } - { - name:"King Standard", - code:"rotk_sta", - order: 21, - sites:"KING", - cancelRingBearerSkirmish:true, - banned:["1_40", "1_45","1_80", "1_108", "1_139", "1_195", "1_234", "1_248", "1_313", "2_32", "2_101", "2_108", "3_38", "3_42", "3_67", "3_68", "3_106", "3_108"], - set:[1, 2, 3, 4, 5, 6, 7] - } - { - name:"Movie Block - Sets 1-7", - code:"movie7", - order: 22, - sites:"KING", - banned:["8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", "7_49", "1_313", "1_234"], - set:[1, 2, 3, 4, 5, 6, 7], - hall:false - } - { - name:"Movie Block - Sets 1-8", - code:"movie8", - order: 23, - sites:"KING", - banned:["8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", "7_49", "1_313", "1_234"], - set:[1, 2, 3, 4, 5, 6, 7, 8], - hall:false - } - { - name:"Movie Block - Sets 1-9", - code:"movie9", - order: 24, - sites:"KING", - banned:["8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", "7_49", "1_313", "1_234"], - set:[1, 2, 3, 4, 5, 6, 7, 8, 9], - hall:false - } - { - name:"Movie Block - Sets 1-8, 10", - code:"movie_sans9", - order: 25, - sites:"KING", - banned:["8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", "7_49", "1_313", "1_234"], - set:[1, 2, 3, 4, 5, 6, 7, 8, 10], - hall:false - } - { - name:"Movie Block, no GLR (10R11)", - code:"movie_exp", - order: 26, - sites:"KING", - banned:["8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "10_11", "7_96", "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", "7_49", "1_313", "1_234"], - set:[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], - hall:false - } - { - name:"Pre-Shadows Multipath", - code:"multipath", - order: 27, - sites:"SPECIAL", - banned:["1_138", "1_311", "1_316", "1_331", "1_338", "1_354", "1_355", "1_360", "2_14", "2_75", "3_1", "3_113", "4_73", "4_338", "4_355", "4_357", "7_190", "8_20", "10_11", - "8_1", "8_3", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", "7_49", "1_313", "1_234", "7_156"], - "valid":["0_56-60"], - set:[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - } - { - name:"War of the Ring Block", - code:"war_block", - order: 28, - sites:"SHADOWS", - "restricted":["11_132", "11_100"], - set:[11, 12, 13] - } - { - name:"War of the Ring Block - Set 11", - code:"war_block11", - order: 29, - sites:"SHADOWS", - "restricted":["11_132", "11_100"], - set:[11], - hall:false - } - { - name:"War of the Ring Block - Sets 11-12", - code:"war_block12", - order: 30, - sites:"SHADOWS", - "restricted":["11_132", "11_100"], - set:[11, 12], - hall:false - } - { - name:"War of the Ring Block - Sets 10-14", - code:"war_block14", - order: 31, - sites:"SHADOWS", - "restricted":["11_132", "11_100"], - set:[10, 11, 12, 13, 14], - hall:false - } - { - name:"War of the Ring Standard", - code:"war_standard", - order: 32, - sites:"SHADOWS", - banned:["4_73", "4_276", "4_304", "7_49", "8_1", "10_2", "10_11", "10_91", "11_31", "11_100", "11_132"], - set:[4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] - } - { - name:"Hunters Block", - code:"hunter_block", - order: 33, - sites:"SHADOWS", - set:[15, 17, 18] - } - { - name:"Pre-Hunters Expanded", - code:"pre-hunters_expanded", - sites:"SHADOWS", - order: 34, - banned:["1_45", "1_138", "1_234", "1_311", "1_313", "1_316", "2_121", "3_17", "3_38", "3_42", "3_67", "3_68", "3_108", "3_113", "4_73", "7_49", "8_1", "10_2", "10_11", "10_91", "11_31", "11_100", "11_132"], - "restricted":["1_40", "1_80", "1_108", "1_139", "1_195", "1_248", "2_32", "2_75", "3_106", "4_276", "4_304"], - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] - } - { - name:"Standard", - code:"standard", - order: 35, - sites:"SHADOWS", - banned:["0_1-19", "0_21", "0_22", "0_30-47", "0_62-67", "8_1", "13_188", "11_114", "11_31", "10_11", "15_64", "10_2", "10_91", "11_132", "7_49", "11_100"], - set:[0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] - } - { - name:"Open", - code:"open", - order: 36, - sites:"SHADOWS", - "restricted":["1_248", "7_49", "10_2", "10_91", "11_100", "11_132"], - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] - } - { - name: "Anything Goes", - code:"rev_tow_sta", - order: 37, - sites: "SPECIAL", - cancelRingBearerSkirmish:true, - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 101, 102, 103, - 151, 152, 153 - ] - } - { - name:"French", - code:"french", - order: 38, - sites:"SHADOWS", - banned:["1_40", "1_45", "1_80", "1_108", "1_138", "1_234", "1_248", "1_311", "1_313", "1_316", "2_14", "2_32", "2_75", "2_121", "3_17", "3_38", "3_42", "3_67", "3_68", "3_108", "4_73", "4_304", "5_23", "9_35", "11_31", "11_49", "11_100", "11_114", "11_132", "11_222", "11_226", "11_231", "11_232", "13_11", "13_37", "13_64", "13_188", "14_6"], - set:[0, 1, 2, 3, 4, 5, 6, 9, 11, 12, 13, 14] - } - { - name:"Second Edition", - code:"2nd_ed", - order: 39, - sites:"SECOND_ED", - banned:[], - "restricted":[], - "valid":[], - set:[40], - cancelRingBearerSkirmish:true, - winAtEndOfRegroup:true, - ruleOfFour:false, - "winOnControlling5Sites":true, - hall:false - } - { - name:"The Hobbit Draft Game", - code:"hobbit", - order: 40, - sites:"HOBBIT", - cancelRingBearerSkirmish:true, - "restricted":["30_2", "30_5", "30_6", "30_7", "30_8", "30_9", "30_10", "30_11", "30_12", "30_15", "30_16", "30_17", "30_18", "30_19", "30_29", "30_47", "30_48", "30_58"], - set:[30, 31, 32, 33], - "restrictedName":["Gandalf", "Bilbo"], - hall:true - } - { - name:"PLAYTEST - Fellowship Block (PC)", - code:"test_pc_fotr_block", - order: 41, - sites:"FELLOWSHIP", - cancelRingBearerSkirmish:true, - hall:true, - playtest:true, - set:[1, 2, 3, 101, 151], - erratasets: [ - 51,52,53, - 71,72,73 - ] - } - { - name:"PLAYTEST - Movie Block (PC)", - code:"test_pc_movie", - order: 42, - sites:"KING", - hall:true, - playtest:true, - set:[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101, 151], - 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)", - code:"test_pc_expanded", - sites:"SHADOWS", - order: 43, - 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, 100, 101, 151], - 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", - code:"fotr_poorman", - sites:"FELLOWSHIP", - cancelRingBearerSkirmish:true, - banned:["1_1", "1_13", "1_14", "1_15", "1_16", "1_22", "1_23", "1_28", "1_30", "1_33", "1_34", "1_35", "1_36", "1_38", "1_40", "1_45", "1_47", "1_49", "1_50", "1_55", "1_62", "1_66", "1_69", - "1_71", "1_72", "1_75", "1_79", "1_80", "1_81", "1_83", "1_87", "1_88", "1_89", "1_90", "1_93", "1_95", "1_96", "1_99", "1_100", "1_111", "1_114", "1_115", "1_118", "1_120", "1_123", "1_124", - "1_125", "1_127", "1_128", "1_129", "1_131", "1_132", "1_137", "1_139", "1_140", "1_143", "1_147", "1_148", "1_155", "1_163", "1_165", "1_166", "1_167", "1_169", "1_170", "1_172", "1_173", - "1_175", "1_183", "1_186", "1_189", "1_190", "1_195", "1_199", "1_200", "1_204", "1_205", "1_206", "1_208", "1_210", "1_212", "1_214", "1_216", "1_217", "1_221", "1_224", "1_228", "1_229", - "1_230", "1_236", "1_237", "1_240", "1_243", "1_244", "1_245", "1_246", "1_247", "1_250", "1_252", "1_253", "1_254", "1_256", "1_259", "1_263", "1_264", "1_265", "1_272", "1_276", "1_279", - "1_282", "1_284", "1_288", "1_289", "1_291", "1_302", "1_307", "1_308", "1_310", "1_313", "1_314", "1_318", "2_1", "2_7", "2_11", "2_12", "2_15", "2_19", "2_20", "2_22", "2_25", "2_27", - "2_32", "2_36", "2_38", "2_39", "2_43", "2_45", "2_46", "2_49", "2_50", "2_52", "2_53", "2_57", "2_66", "2_73", "2_74", "2_75", "2_77", "2_80", "2_84", "2_85", "2_86", "2_93", "2_94", "2_97", - "2_100", "2_105", "2_108", "2_109", "2_112", "2_113", "3_1", "3_3", "3_8", "3_13", "3_15", "3_17", "3_19", "3_21", "3_23", "3_27", "3_29", "3_34", "3_38", "3_39", "3_40", "3_41", "3_42", - "3_44", "3_50", "3_52", "3_54", "3_64", "3_65", "3_66", "3_67", "3_68", "3_71", "3_77", "3_80", "3_81", "3_85", "3_91", "3_93", "3_99", "3_102", "3_103", "3_104", "3_105", "3_110", "3_113"], - set:[1, 2, 3], - hall:false - } - { - name:"Fellowship Block - Highlander", - code:"fotr_highlander", - sites:"FELLOWSHIP", - cancelRingBearerSkirmish:true, - maximumSameName:1, - set:[1, 2, 3], - hall:false - } - { - name:"Movie Block - Highlander", - code:"movie_highlander", - sites:"KING", - maximumSameName:1, - set:[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], - hall:false - } - { - name:"Limited - Hobbit", - code:"limited_hobbit", - sites:"HOBBIT", - cancelRingBearerSkirmish:true, - Limited:true, - set:[30, 31, 32, 33], - hall:false - } - { - name:"Limited - FOTR", - code:"limited_fotr", - sites:"FELLOWSHIP", - cancelRingBearerSkirmish:true, - maximumSameName:100, - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], - hall:false - } - { - name:"Limited - FOTR (PC)", - code:"limited_fotr_pc", - sites:"FELLOWSHIP", - cancelRingBearerSkirmish:true, - maximumSameName:100, - set:[1, 2, 3, 101], - erratasets: [ - 51,52,53, - 71,72,73 - ], - hall:false - } - { - name:"Limited - TTT", - code:"limited_ttt", - sites:"TWO_TOWERS", - cancelRingBearerSkirmish:true, - maximumSameName:100, - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], - hall:false - } - { - name:"Limited - ROTK", - code:"limited_king", - sites:"KING", - cancelRingBearerSkirmish:true, - maximumSameName:100, - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], - hall:false - } - { - name:"Limited - WOTR", - code:"limited_shadows", - sites:"SHADOWS", - cancelRingBearerSkirmish:false, - maximumSameName:100, - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], - hall:false - } - { - name:"Limited - TH", - code:"limited_hunters", - sites:"SHADOWS", - cancelRingBearerSkirmish:false, - maximumSameName:100, - set:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], - hall:false - } { - name:"Limited - Multipath Movie", - code:"limited_multipath", - sites:"SPECIAL", - cancelRingBearerSkirmish:false, - maximumSameName:100, - set:[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], - hall:false - } + name: Debug + code: debug + sites: SPECIAL + maximumSameName: 100 + set: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 101, 151 + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69 + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 200 + ] + hall: false + } + { + name: Fellowship Block + code: fotr_block + order: 1 + sites: FELLOWSHIP + cancelRingBearerSkirmish: true + set: [ + 1, 2, 3 + ] + } + { + name: Fellowship Block (PC) + code: pc_fotr_block + order: 2 + sites: FELLOWSHIP + cancelRingBearerSkirmish: true + winAtEndOfRegroup: true + discardPileIsPublic: true + set: [ + 1, 2, 3, 101 + ] + erratasets: [ + 51,52,53 + ] + } + { + name: Movie Block + code: movie + order: 3 + sites: KING + banned: [ + "8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", "3_42", + "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", "7_49", "1_313", "1_234" + ] + set: [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + ] + } + { + name: Movie Block (PC) + code: pc_movie + order: 4 + sites: KING + winAtEndOfRegroup: true + discardPileIsPublic: true + set: [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101 + ] + erratasets: [ + 51,52,53,54,55,56,57,58,59,60 + ] + } + { + name: Expanded + code: expanded + order: 5 + sites: SHADOWS + banned: [ + "1_45", "1_138", "1_234", "1_311", "1_313", "1_316", "2_121", "3_17", "3_38", "3_42", + "3_67", "3_68", "3_108", "3_113", "4_73", "7_49", "8_1", "10_2", "10_11", "10_91", + "11_31", "11_100", "11_132" + ] + restricted: [ + "1_40", "1_80", "1_108", "1_139", "1_195", "1_248", "2_32", "2_75", "3_106", "4_276", "4_304" + ] + set: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 + ] + } + { + name: Expanded (PC) + code: pc_expanded + order: 6 + sites: SHADOWS + winAtEndOfRegroup: true + discardPileIsPublic: true + set: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 100, 101 + ] + 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 + code: fotr1_block + order: 7 + sites: FELLOWSHIP + cancelRingBearerSkirmish: true + set: [ + 1 + ] + hall: false + } + { + name: Fellowship Block - Sets 1-2 + code: fotr2_block + order: 8 + sites: FELLOWSHIP + cancelRingBearerSkirmish: true + set: [ + 1, 2 + ] + hall: false + } + { + name: Towers Block + code: ttt_block + order: 9 + sites: TWO_TOWERS + cancelRingBearerSkirmish: true + set: [ + 4, 5, 6 + ] + } + { + name: Towers Open - Sets 1-4 + code: open_legacy + order: 10 + sites: TWO_TOWERS + cancelRingBearerSkirmish: true + set: [ + 1, 2, 3, 4 + ] + hall: false + } + { + name: Towers Block - Set 4 + code: ttt1_block + order: 11 + sites: TWO_TOWERS + cancelRingBearerSkirmish: true + set: [ + 4 + ] + hall: false + } + { + name: Towers Block - Sets 4-5 + code: ttt2_block" + order: 12 + sites: TWO_TOWERS + cancelRingBearerSkirmish: true + set: [ + 4, 5 + ] + hall: false + } + + { + name: Towers Standard + code: towers_standard + order: 13 + sites: TWO_TOWERS + cancelRingBearerSkirmish: true + banned: [ + "1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32", + "2_101", "2_108", "3_38", "3_42", "3_68", "4_192" + ] + set: [ + 1, 2, 3, 4, 5, 6 + ] + } + { + name: Towers Standard - Sets 1-4 + code: ttt_standard + order: 14 + sites: TWO_TOWERS + cancelRingBearerSkirmish: true + banned: [ + "1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32", + "2_101", "2_108", "3_38", "3_42", "3_68", "4_192" + ] + set: [ + 1, 2, 3, 4 + ] + hall: false + } + { + name: Towers Standard - Sets 1-5 + code: bohd_standard + order: 15 + sites: TWO_TOWERS + cancelRingBearerSkirmish: true + banned: [ + "1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32", + "2_101", "2_108", "3_38", "3_42", "3_68", "4_192" + ] + set: [ + 1, 2, 3, 4, 5 + ] + hall: false + } + { + name: Towers Standard - Sets 2-6 + code: ts_no_fotr + order: 16 + sites: TWO_TOWERS + cancelRingBearerSkirmish: true + banned: [ + "1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32", + "2_101", "2_108", "3_38", "3_42", "3_68", "4_192" + ] + set: [ + 2, 3, 4, 5, 6 + ] + hall: false + } + { + name: Enhanced Towers Standard + code: ts_reflections + order: 17 + sites: TWO_TOWERS + cancelRingBearerSkirmish: false + banned: [ + "1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32", + "2_101", "2_108", "3_38", "3_42", "3_68", "4_192" + ] + set: [ + 1, 2, 3, 4, 5, 6, 9, 14, 16 + ] + hall: true + } + { + name: King Block + code: king_block + order: 18 + sites: KING + cancelRingBearerSkirmish: true + restricted: [ + "7_49" + ] + set: [ + 7, 8, 10 + ] + } + { + name: King Block - Set 7 + code: king1_block + order: 19 + sites: KING + cancelRingBearerSkirmish: true + restricted: [ + "7_49" + ] + set: [ + 7 + ] + hall: false + } + { + name: King Block - Sets 7-8 + code: king2_block + order: 20 + sites: KING + cancelRingBearerSkirmish: true + restricted: [ + "7_49" + ] + set: [ + 7, 8 + ] + hall: false + } + { + name: King Standard + code: rotk_sta + order: 21 + sites: KING + cancelRingBearerSkirmish: true + banned: [ + "1_40", "1_45","1_80", "1_108", "1_139", "1_195", "1_234", "1_248", "1_313", + "2_32", "2_101", "2_108", "3_38", "3_42", "3_67", "3_68", "3_106", "3_108" + ] + set: [ + 1, 2, 3, 4, 5, 6, 7 + ] + } + { + name: Movie Block - Sets 1-7 + code: movie7 + order: 22 + sites: KING + banned: [ + "8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", + "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", + "7_49", "1_313", "1_234" + ] + set: [ + 1, 2, 3, 4, 5, 6, 7 + ] + hall: false + } + { + name: Movie Block - Sets 1-8 + code: movie8 + order: 23 + sites: KING + banned: [ + "8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", + "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", + "7_49", "1_313", "1_234" + ] + set: [ + 1, 2, 3, 4, 5, 6, 7, 8 + ] + hall: false + } + { + name: Movie Block - Sets 1-9 + code: movie9 + order: 24 + sites: KING + banned: [ + "8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", + "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", + "7_49", "1_313", "1_234" + ] + set: [ + 1, 2, 3, 4, 5, 6, 7, 8, 9 + ] + hall: false + } + { + name: Movie Block - Sets 1-8, 10 + code: movie_sans9 + order: 25 + sites: KING + banned: [ + "8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", + "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", + "7_49", "1_313", "1_234" + ] + set: [ + 1, 2, 3, 4, 5, 6, 7, 8, 10 + ] + hall: false + } + { + name: Movie Block, no GLR (10R11) + code: movie_exp + order: 26 + sites: KING + banned: [ + "8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "10_11", + "7_96", "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", + "1_139", "7_49", "1_313", "1_234" + ] + set: [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + ] + hall: false + } + { + name: Pre-Shadows Multipath + code: multipath + order: 27 + sites: SPECIAL + banned: [ + "1_138", "1_311", "1_316", "1_331", "1_338", "1_354", "1_355", "1_360", + "2_14", "2_75", "3_1", "3_113", "4_73", "4_338", "4_355", "4_357", "7_190", + "8_20", "10_11", "8_1", "8_3", "3_38", "3_106", "1_40", "2_32", "1_248", + "3_108", "1_45", "7_96", "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", + "1_195", "3_68", "1_139", "7_49", "1_313", "1_234", "7_156" + ] + valid: [ + "0_56-60" + ] + set: [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + ] + } + { + name: War of the Ring Block + code: war_block + order: 28 + sites: SHADOWS + restricted: [ + "11_132", "11_100" + ] + set: [ + 11, 12, 13 + ] + } + { + name: War of the Ring Block - Set 11 + code: war_block11 + order: 29 + sites: SHADOWS + restricted: [ + "11_132", "11_100" + ] + set: [ + 11 + ] + hall: false + } + { + name: War of the Ring Block - Sets 11-12 + code: war_block12 + order: 30 + sites: SHADOWS + restricted: [ + "11_132", "11_100" + ] + set: [ + 11, 12 + ] + hall: false + } + { + name: War of the Ring Block - Sets 10-14 + code: war_block14 + order: 31 + sites: SHADOWS + restricted: [ + "11_132", "11_100" + ] + set: [ + 10, 11, 12, 13, 14 + ] + hall: false + } + { + name: War of the Ring Standard + code: war_standard + order: 32 + sites: SHADOWS + banned: [ + "4_73", "4_276", "4_304", "7_49", "8_1", "10_2", "10_11", "10_91", "11_31", + "11_100", "11_132" + ] + set: [ + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 + ] + } + { + name: Hunters Block + code: hunter_block + order: 33 + sites: SHADOWS + set: [ + 15, 17, 18 + ] + } + { + name: Pre-Hunters Expanded + code: pre-hunters_expanded + sites: SHADOWS + order: 34 + banned: [ + "1_45", "1_138", "1_234", "1_311", "1_313", "1_316", "2_121", "3_17", "3_38", + "3_42", "3_67", "3_68", "3_108", "3_113", "4_73", "7_49", "8_1", "10_2", "10_11", + "10_91", "11_31", "11_100", "11_132" + ] + restricted: [ + "1_40", "1_80", "1_108", "1_139", "1_195", "1_248", "2_32", "2_75", "3_106", + "4_276", "4_304" + ] + set: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 + ] + } + { + name: Standard + code: standard + order: 35 + sites: SHADOWS + banned: [ + "0_1-19", "0_21", "0_22", "0_30-47", "0_62-67", "8_1", "13_188", "11_114", "11_31", + "10_11", "15_64", "10_2", "10_91", "11_132", "7_49", "11_100" + ] + set: [ + 0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 + ] + } + { + name: Open + code: open + order: 36 + sites: SHADOWS + restricted: [ + "1_248", "7_49", "10_2", "10_91", "11_100", "11_132" + ] + set: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 + ] + } + { + name: Anything Goes + code: rev_tow_sta + order: 37 + sites: SPECIAL + cancelRingBearerSkirmish: true + set: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69 + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 + 101, 102, 103 + 151, 152, 153 + ] + } + { + name: French + code: french + order: 38 + sites: SHADOWS + banned: [ + "1_40", "1_45", "1_80", "1_108", "1_138", "1_234", "1_248", "1_311", "1_313", + "1_316", "2_14", "2_32", "2_75", "2_121", "3_17", "3_38", "3_42", "3_67", "3_68", + "3_108", "4_73", "4_304", "5_23", "9_35", "11_31", "11_49", "11_100", "11_114", + "11_132", "11_222", "11_226", "11_231", "11_232", "13_11", "13_37", "13_64", + "13_188", "14_6" + ] + set: [ + 0, 1, 2, 3, 4, 5, 6, 9, 11, 12, 13, 14 + ] + } + { + name: Second Edition + code: 2nd_ed + order: 39 + sites: SECOND_ED + banned: [ + + ] + restricted: [ + + ] + valid: [ + + ] + set: [ + 40 + ] + cancelRingBearerSkirmish: true + winAtEndOfRegroup: true + ruleOfFour: false + "winOnControlling5Sites": true + hall: false + } + { + name: The Hobbit Draft Game + code: hobbit + order: 40 + sites: HOBBIT + cancelRingBearerSkirmish: true + restricted: [ + "30_2", "30_5", "30_6", "30_7", "30_8", "30_9", "30_10", "30_11", "30_12", + "30_15", "30_16", "30_17", "30_18", "30_19", "30_29", "30_47", "30_48", "30_58" + ] + set: [ + 30, 31, 32, 33 + ] + restrictedName: [ + "Gandalf", Bilbo + ] + hall: true + } + { + name: PLAYTEST - Fellowship Block (PC) + code: test_pc_fotr_block + order: 41 + sites: FELLOWSHIP + cancelRingBearerSkirmish: true + hall: true + playtest: true + set: [ + 1, 2, 3, 101, 151 + ] + erratasets: [ + 51,52,53 + 71,72,73 + ] + } + { + name: PLAYTEST - Movie Block (PC) + code: test_pc_movie + order: 42 + sites: KING + hall: true + playtest: true + set: [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101, 151 + ] + 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) + code: test_pc_expanded + sites: SHADOWS + order: 43 + 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, 100, 101, 151 + ] + 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 + code: fotr_poorman + sites: FELLOWSHIP + cancelRingBearerSkirmish: true + banned: [ + "1_1", "1_13", "1_14", "1_15", "1_16", "1_22", "1_23", "1_28", "1_30", "1_33", "1_34", "1_35", "1_36", "1_38", "1_40", "1_45", "1_47", "1_49", "1_50", "1_55", "1_62", "1_66", "1_69" + "1_71", "1_72", "1_75", "1_79", "1_80", "1_81", "1_83", "1_87", "1_88", "1_89", "1_90", "1_93", "1_95", "1_96", "1_99", "1_100", "1_111", "1_114", "1_115", "1_118", "1_120", "1_123", "1_124" + "1_125", "1_127", "1_128", "1_129", "1_131", "1_132", "1_137", "1_139", "1_140", "1_143", "1_147", "1_148", "1_155", "1_163", "1_165", "1_166", "1_167", "1_169", "1_170", "1_172", "1_173" + "1_175", "1_183", "1_186", "1_189", "1_190", "1_195", "1_199", "1_200", "1_204", "1_205", "1_206", "1_208", "1_210", "1_212", "1_214", "1_216", "1_217", "1_221", "1_224", "1_228", "1_229" + "1_230", "1_236", "1_237", "1_240", "1_243", "1_244", "1_245", "1_246", "1_247", "1_250", "1_252", "1_253", "1_254", "1_256", "1_259", "1_263", "1_264", "1_265", "1_272", "1_276", "1_279" + "1_282", "1_284", "1_288", "1_289", "1_291", "1_302", "1_307", "1_308", "1_310", "1_313", "1_314", "1_318", "2_1", "2_7", "2_11", "2_12", "2_15", "2_19", "2_20", "2_22", "2_25", "2_27" + "2_32", "2_36", "2_38", "2_39", "2_43", "2_45", "2_46", "2_49", "2_50", "2_52", "2_53", "2_57", "2_66", "2_73", "2_74", "2_75", "2_77", "2_80", "2_84", "2_85", "2_86", "2_93", "2_94", "2_97" + "2_100", "2_105", "2_108", "2_109", "2_112", "2_113", "3_1", "3_3", "3_8", "3_13", "3_15", "3_17", "3_19", "3_21", "3_23", "3_27", "3_29", "3_34", "3_38", "3_39", "3_40", "3_41", "3_42" + "3_44", "3_50", "3_52", "3_54", "3_64", "3_65", "3_66", "3_67", "3_68", "3_71", "3_77", "3_80", "3_81", "3_85", "3_91", "3_93", "3_99", "3_102", "3_103", "3_104", "3_105", "3_110", "3_113" + ] + set: [ + 1, 2, 3 + ] + hall: false + } + { + name: Fellowship Block - Highlander + code: fotr_highlander + sites: FELLOWSHIP + cancelRingBearerSkirmish: true + maximumSameName: 1 + set: [ + 1, 2, 3 + ] + hall: false + } + { + name: Movie Block - Highlander + code: movie_highlander + sites: KING + maximumSameName: 1 + set: [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + ] + hall: false + } + { + name: Limited - Hobbit + code: limited_hobbit + sites: HOBBIT + cancelRingBearerSkirmish: true + Limited: true + set: [ + 30, 31, 32, 33 + ] + hall: false + } + { + name: Limited - FOTR + code: limited_fotr + sites: FELLOWSHIP + cancelRingBearerSkirmish: true + maximumSameName: 100 + set: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 + ] + hall: false + } + { + name: Limited - FOTR (PC) + code: limited_fotr_pc + sites: FELLOWSHIP + cancelRingBearerSkirmish: true + maximumSameName: 100 + set: [ + 1, 2, 3, 101 + ] + erratasets: [ + 51,52,53 + 71,72,73 + ] + hall: false + } + { + name: Limited - TTT + code: limited_ttt + sites: TWO_TOWERS + cancelRingBearerSkirmish: true + maximumSameName: 100 + set: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 + ] + hall: false + } + { + name: Limited - ROTK + code: limited_king + sites: KING + cancelRingBearerSkirmish: true + maximumSameName: 100 + set: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 + ] + hall: false + } + { + name: Limited - WOTR + code: limited_shadows + sites: SHADOWS + cancelRingBearerSkirmish: false + maximumSameName: 100 + set: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 + ] + hall: false + } + { + name: Limited - TH + code: limited_hunters + sites: SHADOWS + cancelRingBearerSkirmish: false + maximumSameName: 100 + set: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 + ] + hall: false + } + { + name: Limited - Multipath Movie + code: limited_multipath + sites: SPECIAL + cancelRingBearerSkirmish: false + maximumSameName: 100 + set: [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + ] + hall: false + } ] \ No newline at end of file diff --git a/gemp-lotr/gemp-lotr-cards/src/main/resources/setConfig.hjson b/gemp-lotr/gemp-lotr-cards/src/main/resources/setConfig.hjson index 186d7af18..a0dd14770 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/resources/setConfig.hjson +++ b/gemp-lotr/gemp-lotr-cards/src/main/resources/setConfig.hjson @@ -1,553 +1,553 @@ [ { - setId: "0", - setName: "Promotional", - rarityFile: "/set0-rarity.txt", + setId: 0 + setName: Promotional + rarityFile: /set0-rarity.txt needsLoading: false } { - setId: "1", - setName: "The Fellowship of the Ring", - rarityFile: "/set1-rarity.txt", + setId: 1 + setName: The Fellowship of the Ring + rarityFile: /set1-rarity.txt needsLoading: false } { - setId: "2", - setName: "Mines of Moria", - rarityFile: "/set2-rarity.txt" + setId: 2 + setName: Mines of Moria + rarityFile: /set2-rarity.txt } { - setId: "3", - setName: "Realms of the Elf-lords", - rarityFile: "/set3-rarity.txt" + setId: 3 + setName: Realms of the Elf-lords + rarityFile: /set3-rarity.txt } { - setId: "4", - setName: "The Two Towers", - rarityFile: "/set4-rarity.txt" + setId: 4 + setName: The Two Towers + rarityFile: /set4-rarity.txt } { - setId: "5", - setName: "Battle of Helm's Deep", - rarityFile: "/set5-rarity.txt" + setId: 5 + setName: Battle of Helm's Deep + rarityFile: /set5-rarity.txt } { - setId: "6", - setName: "Ents of Fangorn", - rarityFile: "/set6-rarity.txt" + setId: 6 + setName: Ents of Fangorn + rarityFile: /set6-rarity.txt } { - setId: "7", - setName: "The Return of the King", - rarityFile: "/set7-rarity.txt" + setId: 7 + setName: The Return of the King + rarityFile: /set7-rarity.txt } { - setId: "8", - setName: "Siege of Gondor", - rarityFile: "/set8-rarity.txt" + setId: 8 + setName: Siege of Gondor + rarityFile: /set8-rarity.txt } { - setId: "9", - setName: "Reflections", - rarityFile: "/set9-rarity.txt", + setId: 9 + setName: Reflections + rarityFile: /set9-rarity.txt needsLoading: false } { - setId: "10", - setName: "Mount Doom", - rarityFile: "/set10-rarity.txt" + setId: 10 + setName: Mount Doom + rarityFile: /set10-rarity.txt } { - setId: "11", - setName: "Shadows", - rarityFile: "/set11-rarity.txt" + setId: 11 + setName: Shadows + rarityFile: /set11-rarity.txt } { - setId: "12", - setName: "Black Rider", - rarityFile: "/set12-rarity.txt" + setId: 12 + setName: Black Rider + rarityFile: /set12-rarity.txt } { - setId: "13", - setName: "Bloodlines", - rarityFile: "/set13-rarity.txt" + setId: 13 + setName: Bloodlines + rarityFile: /set13-rarity.txt } { - setId: "14", - setName: "Expanded Middle-earth", - rarityFile: "/set14-rarity.txt", + setId: 14 + setName: Expanded Middle-earth + rarityFile: /set14-rarity.txt needsLoading: false } { - setId: "15", - setName: "The Hunters", - rarityFile: "/set15-rarity.txt" + setId: 15 + setName: The Hunters + rarityFile: /set15-rarity.txt } { - setId: "16", - setName: "The Wraith Collection", - rarityFile: "/set16-rarity.txt", + setId: 16 + setName: The Wraith Collection + rarityFile: /set16-rarity.txt needsLoading: false } { - setId: "17", - setName: "Rise of Saruman", - rarityFile: "/set17-rarity.txt" + setId: 17 + setName: Rise of Saruman + rarityFile: /set17-rarity.txt } { - setId: "18", - setName: "Treachery & Deceit", - rarityFile: "/set18-rarity.txt" + setId: 18 + setName: Treachery & Deceit + rarityFile: /set18-rarity.txt } { - setId: "19", - setName: "Ages End", - rarityFile: "/set19-rarity.txt", + setId: 19 + setName: Ages End + rarityFile: /set19-rarity.txt needsLoading: false } { - setId: "30", - setName: "Main Deck", - rarityFile: "/set30-rarity.txt", - originalSet: false, - merchantable: false, + setId: 30 + setName: Main Deck + rarityFile: /set30-rarity.txt + originalSet: false + merchantable: false needsLoading: false } { - setId: "31", - setName: "The Short Rest", - rarityFile: "/set31-rarity.txt", - originalSet: false, - merchantable: false, + setId: 31 + setName: The Short Rest + rarityFile: /set31-rarity.txt + originalSet: false + merchantable: false needsLoading: false } { - setId: "32", - setName: "The Clouds Burst", - rarityFile: "/set32-rarity.txt", - originalSet: false, - merchantable: false, + setId: 32 + setName: The Clouds Burst + rarityFile: /set32-rarity.txt + originalSet: false + merchantable: false needsLoading: false } { - setId: "33", - setName: "Fire and Water", - rarityFile: "/set33-rarity.txt", - originalSet: false, - merchantable: false, + setId: 33 + setName: Fire and Water + rarityFile: /set33-rarity.txt + originalSet: false + merchantable: false needsLoading: false } { - setId: "40", - setName: "Second Edition", - rarityFile: "/set40-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 40 + setName: Second Edition + rarityFile: /set40-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: false } { - setId: "50", - setName: "PC Promo Errata", - rarityFile: "/errata/set50-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 50 + setName: PC Promo Errata + rarityFile: /errata/set50-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "51", - setName: "PC FotR Errata", - rarityFile: "/errata/set51-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 51 + setName: PC FotR Errata + rarityFile: /errata/set51-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "52", - setName: "PC MoM Errata", - rarityFile: "/errata/set52-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 52 + setName: PC MoM Errata + rarityFile: /errata/set52-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "53", - setName: "PC RotEL Errata", - rarityFile: "/errata/set53-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 53 + setName: PC RotEL Errata + rarityFile: /errata/set53-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "54", - setName: "PC TTT Errata", - rarityFile: "/errata/set54-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 54 + setName: PC TTT Errata + rarityFile: /errata/set54-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "55", - setName: "PC BoHD Errata", - rarityFile: "/errata/set55-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 55 + setName: PC BoHD Errata + rarityFile: /errata/set55-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "56", - setName: "PC EoF Errata", - rarityFile: "/errata/set56-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 56 + setName: PC EoF Errata + rarityFile: /errata/set56-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "57", - setName: "PC RotK Errata", - rarityFile: "/errata/set57-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 57 + setName: PC RotK Errata + rarityFile: /errata/set57-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "58", - setName: "PC SoG Errata", - rarityFile: "/errata/set58-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 58 + setName: PC SoG Errata + rarityFile: /errata/set58-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "59", - setName: "PC Reflections Errata", - rarityFile: "/errata/set59-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 59 + setName: PC Reflections Errata + rarityFile: /errata/set59-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "80", - setName: "PC MD Errata", - rarityFile: "/errata/set80-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 80 + setName: PC MD Errata + rarityFile: /errata/set80-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "81", - setName: "PC Shadows Errata", - rarityFile: "/errata/set81-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 81 + setName: PC Shadows Errata + rarityFile: /errata/set81-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "82", - setName: "PC BR Errata", - rarityFile: "/errata/set82-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 82 + setName: PC BR Errata + rarityFile: /errata/set82-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "83", - setName: "PC Bloodlines Errata", - rarityFile: "/errata/set83-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 83 + setName: PC Bloodlines Errata + rarityFile: /errata/set83-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "84", - setName: "PC EMM Errata", - rarityFile: "/errata/set84-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 84 + setName: PC EMM Errata + rarityFile: /errata/set84-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "85", - setName: "PC Hunters Errata", - rarityFile: "/errata/set85-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 85 + setName: PC Hunters Errata + rarityFile: /errata/set85-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "86", - setName: "PC TWC Errata", - rarityFile: "/errata/set86-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 86 + setName: PC TWC Errata + rarityFile: /errata/set86-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "87", - setName: "PC RoS Errata", - rarityFile: "/errata/set87-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 87 + setName: PC RoS Errata + rarityFile: /errata/set87-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "88", - setName: "PC T&D Errata", - rarityFile: "/errata/set88-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 88 + setName: PC T&D Errata + rarityFile: /errata/set88-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "89", - setName: "PC AE Errata", - rarityFile: "/errata/set89-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 89 + setName: PC AE Errata + rarityFile: /errata/set89-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "70", - setName: "TEST-PC Promo Errata", - rarityFile: "/errata/set70-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 70 + setName: TEST-PC Promo Errata + rarityFile: /errata/set70-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "71", - setName: "TEST-PC FotR Errata", - rarityFile: "/errata/set71-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 71 + setName: TEST-PC FotR Errata + rarityFile: /errata/set71-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "72", - setName: "TEST-PC MoM Errata", - rarityFile: "/errata/set72-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 72 + setName: TEST-PC MoM Errata + rarityFile: /errata/set72-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "73", - setName: "TEST-PC RotEL Errata", - rarityFile: "/errata/set73-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 73 + setName: TEST-PC RotEL Errata + rarityFile: /errata/set73-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "74", - setName: "TEST-PC TTT Errata", - rarityFile: "/errata/set74-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 74 + setName: TEST-PC TTT Errata + rarityFile: /errata/set74-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "75", - setName: "TEST-PC BoHD Errata", - rarityFile: "/errata/set75-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 75 + setName: TEST-PC BoHD Errata + rarityFile: /errata/set75-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "76", - setName: "TEST-PC EoF Errata", - rarityFile: "/errata/set76-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 76 + setName: TEST-PC EoF Errata + rarityFile: /errata/set76-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "77", - setName: "TEST-PC RotK Errata", - rarityFile: "/errata/set77-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 77 + setName: TEST-PC RotK Errata + rarityFile: /errata/set77-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "78", - setName: "TEST-PC SoG Errata", - rarityFile: "/errata/set78-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 78 + setName: TEST-PC SoG Errata + rarityFile: /errata/set78-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "79", - setName: "TEST-PC Reflections Errata", - rarityFile: "/errata/set79-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 79 + setName: TEST-PC Reflections Errata + rarityFile: /errata/set79-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "80", - setName: "TEST-PC MD Errata", - rarityFile: "/errata/set80-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 80 + setName: TEST-PC MD Errata + rarityFile: /errata/set80-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "81", - setName: "TEST-PC Shadows Errata", - rarityFile: "/errata/set81-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 81 + setName: TEST-PC Shadows Errata + rarityFile: /errata/set81-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "82", - setName: "TEST-PC BR Errata", - rarityFile: "/errata/set82-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 82 + setName: TEST-PC BR Errata + rarityFile: /errata/set82-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "83", - setName: "TEST-PC Bloodlines Errata", - rarityFile: "/errata/set83-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 83 + setName: TEST-PC Bloodlines Errata + rarityFile: /errata/set83-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "84", - setName: "TEST-PC EMM Errata", - rarityFile: "/errata/set84-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 84 + setName: TEST-PC EMM Errata + rarityFile: /errata/set84-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "85", - setName: "TEST-PC Hunters Errata", - rarityFile: "/errata/set85-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 85 + setName: TEST-PC Hunters Errata + rarityFile: /errata/set85-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "86", - setName: "TEST-PC TWC Errata", - rarityFile: "/errata/set86-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 86 + setName: TEST-PC TWC Errata + rarityFile: /errata/set86-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "87", - setName: "TEST-PC RoS Errata", - rarityFile: "/errata/set87-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 87 + setName: TEST-PC RoS Errata + rarityFile: /errata/set87-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "88", - setName: "TEST-PC T&D Errata", - rarityFile: "/errata/set88-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 88 + setName: TEST-PC T&D Errata + rarityFile: /errata/set88-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "89", - setName: "TEST-PC AE Errata", - rarityFile: "/errata/set89-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 89 + setName: TEST-PC AE Errata + rarityFile: /errata/set89-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "100", - setName: "PC Supplements", - rarityFile: "/set100-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 100 + setName: PC Supplements + rarityFile: /set100-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "101", - setName: "Shadow of the Past", - rarityFile: "/set101-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 101 + setName: Shadow of the Past + rarityFile: /set101-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "150", - setName: "TEST-PC Supplements", - rarityFile: "/set150-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 150 + setName: TEST-PC Supplements + rarityFile: /set150-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } { - setId: "151", - setName: "TEST-Shadow of the Past", - rarityFile: "/set151-rarity.txt", - originalSet: false, - merchantable: false, - needsLoading: false, + setId: 151 + setName: TEST-Shadow of the Past + rarityFile: /set151-rarity.txt + originalSet: false + merchantable: false + needsLoading: false playable: true } diff --git a/gemp-lotr/gemp-lotr-common/src/main/java/com/gempukku/lotro/common/JSONDefs.java b/gemp-lotr/gemp-lotr-common/src/main/java/com/gempukku/lotro/common/JSONDefs.java index 0811a616b..4243254de 100644 --- a/gemp-lotr/gemp-lotr-common/src/main/java/com/gempukku/lotro/common/JSONDefs.java +++ b/gemp-lotr/gemp-lotr-common/src/main/java/com/gempukku/lotro/common/JSONDefs.java @@ -61,6 +61,16 @@ public class JSONDefs { } + public static class Set { + public int setId; + public String setName; + public String rarityFile; + public boolean originalSet = true; + public boolean merchantable = true; + public boolean needsLoading = true; + public boolean playable = true; + } + public static class FullFormatReadout { public Map Formats; public Map SealedTemplates; diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroCardBlueprintLibrary.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroCardBlueprintLibrary.java index 3dd4add5b..ab54eac0c 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroCardBlueprintLibrary.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroCardBlueprintLibrary.java @@ -11,7 +11,6 @@ import com.gempukku.util.JsonUtils; import org.apache.commons.io.IOUtils; import org.apache.log4j.Logger; import org.hjson.JsonValue; -import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; @@ -135,34 +134,24 @@ public class LotroCardBlueprintLibrary { try { final InputStreamReader reader = new InputStreamReader(new FileInputStream(_setDefsPath), StandardCharsets.UTF_8); try { - String json = JsonValue.readHjson(reader).toString(); - JSONParser parser = new JSONParser(); - JSONArray object = (JSONArray) parser.parse(json); - for (Object setDefinitionObj : object) { - JSONObject setDefinition = (JSONObject) setDefinitionObj; + var setDefs = JsonUtils.ConvertArray(reader, JSONDefs.Set.class); - String setId = (String) setDefinition.get("setId"); - String setName = (String) setDefinition.get("setName"); - String rarityFile = (String) setDefinition.get("rarityFile"); + for (JSONDefs.Set def : setDefs) { + if (def == null) + continue; - Set flags = new HashSet<>(); - determineOriginalSetFlag(setDefinition, flags); - determineMerchantableFlag(setDefinition, flags); - determineNeedsLoadingFlag(setDefinition, flags); - - DefaultSetDefinition rarity = new DefaultSetDefinition(setId, setName, flags); - - readSetRarityFile(rarity, setId, rarityFile); - - _allSets.put(setId, rarity); + var set = new DefaultSetDefinition(def); + readSetRarityFile(set, set.getSetId(), def.rarityFile); + _allSets.put(set.getSetId(), set); } + } finally { IOUtils.closeQuietly(reader); } - } catch (ParseException e) { - throw new RuntimeException("Unable to parse setConfig.json file"); } catch (IOException exp) { throw new RuntimeException("Unable to read card rarities: " + exp); + } catch (Exception exp) { + throw new RuntimeException("Unable to parse setConfig.hjson file: " + exp); } } @@ -235,20 +224,21 @@ public class LotroCardBlueprintLibrary { } private void cacheAllJavaBlueprints() { - for (SetDefinition setDefinition : _allSets.values()) { - if (setDefinition.hasFlag("needsLoading")) { - logger.debug("Loading Java cards for set " + setDefinition.getSetId()); - final Set allCards = setDefinition.getAllCards(); - for (String blueprintId : allCards) { - if (getBaseBlueprintId(blueprintId).equals(blueprintId)) { - if (!_blueprints.containsKey(blueprintId)) { - try { - // Ensure it's loaded - LotroCardBlueprint blueprint = findJavaBlueprint(blueprintId); - _blueprints.put(blueprintId, blueprint); - } catch (CardNotFoundException exp) { - throw new RuntimeException("Unable to start the server, due to invalid (missing) card definition - " + blueprintId); - } + for (var setDef : _allSets.values()) { + if(!setDef.NeedsLoading()) + continue; + + logger.debug("Loading Java cards for set " + setDef.getSetId()); + final Set allCards = setDef.getAllCards(); + for (String blueprintId : allCards) { + if (getBaseBlueprintId(blueprintId).equals(blueprintId)) { + if (!_blueprints.containsKey(blueprintId)) { + try { + // Ensure it's loaded + LotroCardBlueprint blueprint = findJavaBlueprint(blueprintId); + _blueprints.put(blueprintId, blueprint); + } catch (CardNotFoundException exp) { + throw new RuntimeException("Unable to start the server, due to invalid (missing) card definition - " + blueprintId); } } } diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/packs/DefaultSetDefinition.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/packs/DefaultSetDefinition.java index fced41cdc..8d187186a 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/packs/DefaultSetDefinition.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/packs/DefaultSetDefinition.java @@ -1,24 +1,31 @@ package com.gempukku.lotro.game.packs; +import com.gempukku.lotro.common.JSONDefs; + import java.util.*; public class DefaultSetDefinition implements SetDefinition { private final List _tengwarCards = new LinkedList<>(); private final Map> _rarityList = new HashMap<>(); private final Map _cardsRarity = new LinkedHashMap<>(); - private final String _setId; - private final String _setName; - private final Set _flags; - public DefaultSetDefinition(String setId, String setName, Set flags) { - _setId = setId; - _setName = setName; - _flags = flags; + public final String ID; + public final String Name; + public final boolean IsDecipherSet; + public final boolean Merchantable; + public final boolean NeedsLoading; + + public DefaultSetDefinition(JSONDefs.Set setdef) { + ID = String.valueOf(setdef.setId); + Name = setdef.setName; + IsDecipherSet = setdef.originalSet; + Merchantable = setdef.merchantable;; + NeedsLoading = setdef.needsLoading;; } public void addCard(String blueprintId, String rarity) { _cardsRarity.put(blueprintId, rarity); - List cardsOfRarity = _rarityList.get(rarity); + var cardsOfRarity = _rarityList.get(rarity); if (cardsOfRarity == null) { cardsOfRarity = new LinkedList<>(); _rarityList.put(rarity, cardsOfRarity); @@ -32,18 +39,20 @@ public class DefaultSetDefinition implements SetDefinition { @Override public String getSetName() { - return _setName; + return Name; } @Override public String getSetId() { - return _setId; + return ID; } @Override - public boolean hasFlag(String flag) { - return _flags.contains(flag); - } + public boolean IsDecipherSet() { return IsDecipherSet; }; + @Override + public boolean Merchantable() { return Merchantable; }; + @Override + public boolean NeedsLoading() { return NeedsLoading; }; @Override public List getCardsOfRarity(String rarity) { diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/packs/SetDefinition.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/packs/SetDefinition.java index e9d2e8ec8..8e4e4eb0a 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/packs/SetDefinition.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/packs/SetDefinition.java @@ -8,8 +8,9 @@ public interface SetDefinition { public String getSetId(); - public boolean hasFlag(String flag); - + public boolean IsDecipherSet(); + public boolean Merchantable(); + public boolean NeedsLoading(); public List getCardsOfRarity(String rarity); public List getTengwarCards(); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/LotroFormatLibrary.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/LotroFormatLibrary.java index 68c330707..80023dab5 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/LotroFormatLibrary.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/LotroFormatLibrary.java @@ -1,6 +1,5 @@ package com.gempukku.lotro.game.formats; -import com.alibaba.fastjson.JSON; import com.gempukku.lotro.common.AppConfig; import com.gempukku.lotro.common.JSONDefs; import com.gempukku.lotro.game.AdventureLibrary; @@ -8,8 +7,6 @@ import com.gempukku.lotro.game.LotroCardBlueprintLibrary; import com.gempukku.lotro.game.LotroFormat; import com.gempukku.lotro.league.SealedLeagueDefinition; import com.gempukku.util.JsonUtils; -import org.hjson.JsonValue; -import org.json.simple.parser.JSONParser; import java.io.*; import java.nio.charset.StandardCharsets; @@ -72,7 +69,6 @@ public class LotroFormatLibrary { private void loadTemplateFromFile(File file) { if (!JsonUtils.IsValidHjsonFile(file)) return; - JSONParser parser = new JSONParser(); try (Reader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)) { var defs = JsonUtils.ConvertArray(reader, JSONDefs.SealedTemplate.class); @@ -108,9 +104,7 @@ public class LotroFormatLibrary { public void ReloadFormats() { try (InputStreamReader reader = new InputStreamReader(new FileInputStream(_formatPath), StandardCharsets.UTF_8)) { collectionReady.acquire(); - String json = JsonValue.readHjson(reader).toString(); - - JSONDefs.Format[] formatDefs = JSON.parseObject(json, JSONDefs.Format[].class); + var formatDefs = JsonUtils.ConvertArray(reader, JSONDefs.Format.class); _allFormats.clear(); _hallFormats.clear(); @@ -119,7 +113,7 @@ public class LotroFormatLibrary { if (def == null) continue; - DefaultLotroFormat format = new DefaultLotroFormat(_adventureLibrary, _cardLibrary, def); + var format = new DefaultLotroFormat(_adventureLibrary, _cardLibrary, def); _allFormats.put(format.getCode(), format); if (format.hallVisible()) { diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/FixedLeaguePrizes.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/FixedLeaguePrizes.java index 3bb5e8b12..aa69d4f88 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/FixedLeaguePrizes.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/FixedLeaguePrizes.java @@ -19,7 +19,7 @@ public class FixedLeaguePrizes implements LeaguePrizes { public FixedLeaguePrizes(LotroCardBlueprintLibrary library) { for (SetDefinition setDefinition : library.getSetDefinitions().values()) { - if (setDefinition.hasFlag("originalSet")) { + if (setDefinition.IsDecipherSet()) { _commons.addAll(setDefinition.getCardsOfRarity("C")); _uncommons.addAll(setDefinition.getCardsOfRarity("U")); _rares.addAll(setDefinition.getCardsOfRarity("R")); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/MerchantService.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/MerchantService.java index 4be9836a0..31fc64313 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/MerchantService.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/MerchantService.java @@ -33,7 +33,7 @@ public class MerchantService { _merchant = new RarityBasedMerchant(library); for (SetDefinition setDefinition : library.getSetDefinitions().values()) { - if (setDefinition.hasFlag("merchantable")) { + if (setDefinition.Merchantable()) { for (String blueprintId : setDefinition.getAllCards()) { String baseBlueprintId = library.getBaseBlueprintId(blueprintId); _merchantableItems.add(new BasicCardItem(baseBlueprintId)); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/RarityBasedMerchant.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/RarityBasedMerchant.java index d322575c9..e90ef0da2 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/RarityBasedMerchant.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/RarityBasedMerchant.java @@ -12,7 +12,7 @@ public class RarityBasedMerchant implements Merchant { public RarityBasedMerchant(LotroCardBlueprintLibrary library) { for (SetDefinition setDefinition : library.getSetDefinitions().values()) { - if (setDefinition.hasFlag("merchantable")) + if (setDefinition.Merchantable()) _rarity.put(setDefinition.getSetId(), setDefinition); } } diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/StorageBasedMerchant.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/StorageBasedMerchant.java index 33f78ac56..ff2ac0db8 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/StorageBasedMerchant.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/StorageBasedMerchant.java @@ -38,7 +38,7 @@ public class StorageBasedMerchant implements Merchant { _merchantDao = merchantDao; _merchantSetupDate = merchantSetupDate; for (SetDefinition setDefinition : _library.getSetDefinitions().values()) { - if (setDefinition.hasFlag("merchantable")) + if (setDefinition.Merchantable()) _rarity.put(setDefinition.getSetId(), setDefinition); } } diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/DailyTournamentPrizes.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/DailyTournamentPrizes.java index 0b496e274..b44391ea3 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/DailyTournamentPrizes.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/DailyTournamentPrizes.java @@ -17,7 +17,7 @@ public class DailyTournamentPrizes implements TournamentPrizes { public DailyTournamentPrizes(LotroCardBlueprintLibrary library, String registryRepresentation) { _registryRepresentation = registryRepresentation; for (SetDefinition setDefinition : library.getSetDefinitions().values()) { - if (setDefinition.hasFlag("originalSet")) + if (setDefinition.IsDecipherSet()) _promos.addAll(setDefinition.getCardsOfRarity("P")); } } diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/SingleEliminationOnDemandPrizes.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/SingleEliminationOnDemandPrizes.java index 548e75d8b..70bf67455 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/SingleEliminationOnDemandPrizes.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/SingleEliminationOnDemandPrizes.java @@ -17,7 +17,7 @@ public class SingleEliminationOnDemandPrizes implements TournamentPrizes{ public SingleEliminationOnDemandPrizes(LotroCardBlueprintLibrary library, String registryRepresentation) { _registryRepresentation = registryRepresentation; for (SetDefinition setDefinition : library.getSetDefinitions().values()) { - if (setDefinition.hasFlag("originalSet")) + if (setDefinition.IsDecipherSet()) _promos.addAll(setDefinition.getCardsOfRarity("P")); } }