mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-28 11:53:11 -07:00
add an isEmpty method to printing info (#6805)
no reason, I just find it easier to understand
This commit is contained in:
@@ -133,7 +133,7 @@ ExactCard CardDatabaseQuerier::getRandomCard() const
|
||||
ExactCard CardDatabaseQuerier::getCardFromSameSet(const QString &cardName, const PrintingInfo &otherPrinting) const
|
||||
{
|
||||
// The source card does not have a printing defined, which means we can't get a card from the same set.
|
||||
if (otherPrinting == PrintingInfo()) {
|
||||
if (otherPrinting.isEmpty()) {
|
||||
return getCard({cardName});
|
||||
}
|
||||
|
||||
@@ -360,4 +360,4 @@ QMap<QString, int> CardDatabaseQuerier::getAllFormatsWithCount() const
|
||||
}
|
||||
|
||||
return formatCounts;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,16 @@ public:
|
||||
return this->set == other.set && this->properties == other.properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief check if the info is empty, as if default constructed.
|
||||
*
|
||||
* @return True if both set and properties are empty, otherwise false.
|
||||
*/
|
||||
bool isEmpty() const
|
||||
{
|
||||
return set == nullptr && properties.isEmpty();
|
||||
}
|
||||
|
||||
private:
|
||||
CardSetPtr set; ///< The set this variation belongs to.
|
||||
QVariantHash properties; ///< Key-value store for variation-specific attributes.
|
||||
|
||||
Reference in New Issue
Block a user