[CardInfo] Refactor: add getLegalityProp method (#6536)

This commit is contained in:
RickyRister 2026-01-22 20:33:21 -08:00 committed by GitHub
parent 39ddaa0c35
commit 2e1a0bec93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 9 deletions

View file

@ -719,13 +719,12 @@ static bool isCardQuantityLegalForFormat(const QString &format, const CardInfo &
return true;
}
const QString legalityProp = "format-" + format;
if (!cardInfo.getProperties().contains(legalityProp)) {
// check legality prop
const QString legality = cardInfo.getLegalityProp(format);
if (legality.isEmpty()) {
return false;
}
const QString legality = cardInfo.getProperty(legalityProp);
int maxAllowed = maxAllowedForLegality(*formatRules, legality);
if (maxAllowed == -1) {