Updated collection checking to account for errata in sealed leagues
This commit is contained in:
@@ -51,6 +51,10 @@ public interface LotroFormat {
|
|||||||
|
|
||||||
public Map<String,String> getErrataCardMap();
|
public Map<String,String> getErrataCardMap();
|
||||||
|
|
||||||
|
public String applyErrata(String bpID);
|
||||||
|
|
||||||
|
public String findBaseCard(String bpID);
|
||||||
|
|
||||||
public SitesBlock getSiteBlock();
|
public SitesBlock getSiteBlock();
|
||||||
|
|
||||||
public String getSurveyUrl();
|
public String getSurveyUrl();
|
||||||
|
|||||||
@@ -479,6 +479,16 @@ public class DefaultLotroFormat implements LotroFormat {
|
|||||||
return deckWithErrata;
|
return deckWithErrata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String applyErrata(String bpID) {
|
||||||
|
return _errataCardMap.getOrDefault(bpID, bpID);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String findBaseCard(String bpID) {
|
||||||
|
return _library.getBaseBlueprintId(bpID);
|
||||||
|
}
|
||||||
|
|
||||||
private String validateDeckStructure(LotroDeck deck) {
|
private String validateDeckStructure(LotroDeck deck) {
|
||||||
String result = "";
|
String result = "";
|
||||||
if (deck.getAdventureCards().size() < _minimumDeckSize) {
|
if (deck.getAdventureCards().size() < _minimumDeckSize) {
|
||||||
|
|||||||
@@ -689,7 +689,10 @@ public class HallServer extends AbstractServer {
|
|||||||
Map<String, Integer> deckCardCounts = CollectionUtils.getTotalCardCountForDeck(lotroDeck);
|
Map<String, Integer> deckCardCounts = CollectionUtils.getTotalCardCountForDeck(lotroDeck);
|
||||||
|
|
||||||
for (Map.Entry<String, Integer> cardCount : deckCardCounts.entrySet()) {
|
for (Map.Entry<String, Integer> cardCount : deckCardCounts.entrySet()) {
|
||||||
final int collectionCount = collection.getItemCount(cardCount.getKey());
|
final int collectionCount = collection.getItemCount(cardCount.getKey()) +
|
||||||
|
collection.getItemCount(format.findBaseCard(cardCount.getKey())) +
|
||||||
|
collection.getItemCount(format.applyErrata(cardCount.getKey()));
|
||||||
|
|
||||||
if (collectionCount < cardCount.getValue()) {
|
if (collectionCount < cardCount.getValue()) {
|
||||||
String cardName = null;
|
String cardName = null;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user