Fix various hints and warnings on many set & block classes (via IntelliJ IDEA linting):

- replacing hard coded strings of set codes with reference to 'mage.sets.<set>.getInstance().getCode()' allows for set class names to no longer show as unreferenced & adds for more consistence between other block units
- various protected variables were able to be changed to private to clean up additional warnings
- some JavaDoc comments were generating warnings due to missing documentation
- removed some unused imports and unused variables
- there were multiple conditional logic checks for 'rarity != Rarity.LAND' within an if block where the outer condition was 'if rarity == Rarity.COMMON' rendering the inner condition always true and thus redundant
- a few ExpansionSet.buildDate parameters wer using octal values (eg. '03' instead of '3') which triggered some warnings
- added a booster generation test for WarOfTheSparks to make sure every booster contains a planeswalker
- added a booster generation test for ModernHorizons to make sure every booster contains a snow land
- booster generation test for Battlbond set referenced the Coldsnap set class instead of Battlebond
This commit is contained in:
Mike Simons 2019-07-18 23:28:48 -04:00
parent bbd1390397
commit 8d08f005af
37 changed files with 94 additions and 95 deletions

View file

@ -1,9 +1,7 @@
package mage.sets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import mage.cards.Card;
import mage.cards.ExpansionSet;
import mage.cards.repository.CardCriteria;
import mage.cards.repository.CardInfo;
@ -23,8 +21,8 @@ public final class CoreSet2019 extends ExpansionSet {
public static CoreSet2019 getInstance() {
return instance;
}
List<CardInfo> savedSpecialCommon = new ArrayList<>();
protected final List<CardInfo> savedSpecialLand = new ArrayList<>();
private final List<CardInfo> savedSpecialLand = new ArrayList<>();
private CoreSet2019() {
super("Core Set 2019", "M19", ExpansionSet.buildDate(2018, 7, 13), SetType.CORE);
@ -372,7 +370,7 @@ public final class CoreSet2019 extends ExpansionSet {
criteria.setCodes(this.code).notTypes(CardType.LAND);
savedCardsInfos = CardRepository.instance.findCards(criteria);
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster && rarity != Rarity.LAND);
savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster);
}
savedCards.put(rarity, savedCardsInfos);
}