Attempting to get the errata to work with sealed leagues
This commit is contained in:
@@ -53,7 +53,7 @@ public interface LotroFormat {
|
||||
|
||||
public String applyErrata(String bpID);
|
||||
|
||||
public String findBaseCard(String bpID);
|
||||
public List<String> findBaseCards(String bpID);
|
||||
|
||||
public SitesBlock getSiteBlock();
|
||||
|
||||
|
||||
@@ -485,8 +485,8 @@ public class DefaultLotroFormat implements LotroFormat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String findBaseCard(String bpID) {
|
||||
return _library.getBaseBlueprintId(bpID);
|
||||
public List<String> findBaseCards(String bpID) {
|
||||
return _errataCardMap.values().stream().filter(x-> x.equals(bpID)).toList();
|
||||
}
|
||||
|
||||
private String validateDeckStructure(LotroDeck deck) {
|
||||
|
||||
@@ -689,10 +689,13 @@ public class HallServer extends AbstractServer {
|
||||
Map<String, Integer> deckCardCounts = CollectionUtils.getTotalCardCountForDeck(lotroDeck);
|
||||
|
||||
for (Map.Entry<String, Integer> cardCount : deckCardCounts.entrySet()) {
|
||||
final int collectionCount = collection.getItemCount(cardCount.getKey()) +
|
||||
collection.getItemCount(format.findBaseCard(cardCount.getKey())) +
|
||||
int collectionCount = collection.getItemCount(cardCount.getKey()) +
|
||||
collection.getItemCount(format.applyErrata(cardCount.getKey()));
|
||||
|
||||
for(String id : format.findBaseCards(cardCount.getKey())) {
|
||||
collectionCount += collection.getItemCount(id);
|
||||
}
|
||||
|
||||
if (collectionCount < cardCount.getValue()) {
|
||||
String cardName = null;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user