[CardInfo] Refactor: add getLegalityProp method

This commit is contained in:
RickyRister 2026-01-18 23:33:03 -08:00
parent af2995ba96
commit 2e5ecf36e3
5 changed files with 20 additions and 9 deletions

View file

@ -75,13 +75,18 @@ QString CardInfo::getCorrectedName() const
return result.remove(rmrx).replace(spacerx, space);
}
QString CardInfo::getLegalityProp(const QString &format) const
{
return getProperty("format-" + format);
}
bool CardInfo::isLegalInFormat(const QString &format) const
{
if (format.isEmpty()) {
return true;
}
QString formatLegality = getProperty("format-" + format);
QString formatLegality = getLegalityProp(format);
return formatLegality == "legal" || formatLegality == "restricted";
}