mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
initial commit for card search dialog
This commit is contained in:
parent
324be6b40c
commit
42531d90e9
10 changed files with 220 additions and 8 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include <QSvgRenderer>
|
||||
#include <QPainter>
|
||||
#include <QUrl>
|
||||
#include <QSet>
|
||||
|
||||
CardSet::CardSet(const QString &_shortName, const QString &_longName)
|
||||
: shortName(_shortName), longName(_longName)
|
||||
|
|
@ -503,3 +504,24 @@ void CardDatabase::updateDatabasePath(const QString &path)
|
|||
if (!cardDatabasePath.isEmpty())
|
||||
loadFromFile(cardDatabasePath);
|
||||
}
|
||||
|
||||
QStringList CardDatabase::getAllColors() const
|
||||
{
|
||||
QSet<QString> colors;
|
||||
QHashIterator<QString, CardInfo *> cardIterator(cardHash);
|
||||
while (cardIterator.hasNext()) {
|
||||
const QStringList &cardColors = cardIterator.next().value()->getColors();
|
||||
for (int i = 0; i < cardColors.size(); ++i)
|
||||
colors.insert(cardColors[i]);
|
||||
}
|
||||
return colors.toList();
|
||||
}
|
||||
|
||||
QStringList CardDatabase::getAllMainCardTypes() const
|
||||
{
|
||||
QSet<QString> types;
|
||||
QHashIterator<QString, CardInfo *> cardIterator(cardHash);
|
||||
while (cardIterator.hasNext())
|
||||
types.insert(cardIterator.next().value()->getMainCardType());
|
||||
return types.toList();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue