mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 08:52:15 -07:00
[CardInfo] Refactor: add getLegalityProp method
This commit is contained in:
parent
af2995ba96
commit
2e5ecf36e3
5 changed files with 20 additions and 9 deletions
|
|
@ -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";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue