mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 18:43:55 -07:00
[CardInfo] Refactor: add getLegalityProp method (#6536)
This commit is contained in:
parent
39ddaa0c35
commit
2e1a0bec93
5 changed files with 20 additions and 9 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue