mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-13 05:54:06 -07:00
Use getCards()
Took 4 minutes
This commit is contained in:
parent
2c4920560c
commit
07a67e5854
1 changed files with 61 additions and 69 deletions
|
|
@ -19,27 +19,20 @@ void DeckListStatisticsAnalyzer::analyze()
|
|||
{
|
||||
clearData();
|
||||
|
||||
auto nodes = model->getDeckList()->getCardNodes();
|
||||
QList<ExactCard> cards = model->getCards();
|
||||
|
||||
for (auto *node : nodes) {
|
||||
CardInfoPtr info = CardDatabaseManager::query()->getCardInfo(node->getName());
|
||||
if (!info) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const int count = node->getNumber();
|
||||
const int cmc = info->getCmc().toInt();
|
||||
for (auto card : cards) {
|
||||
auto info = card.getInfo();
|
||||
const int cmc = info.getCmc().toInt();
|
||||
|
||||
// Convert once
|
||||
QStringList types = info->getMainCardType().split(' ');
|
||||
QStringList subtypes = info->getCardType().split('-').last().split(" ");
|
||||
QString colors = info->getColors();
|
||||
int power = info->getPowTough().split("/").first().toInt();
|
||||
int toughness = info->getPowTough().split("/").last().toInt();
|
||||
QStringList types = info.getMainCardType().split(' ');
|
||||
QStringList subtypes = info.getCardType().split('-').last().split(" ");
|
||||
QString colors = info.getColors();
|
||||
int power = info.getPowTough().split("/").first().toInt();
|
||||
int toughness = info.getPowTough().split("/").last().toInt();
|
||||
|
||||
// For each copy of card
|
||||
for (int i = 0; i < count; ++i) {
|
||||
|
||||
// ---------------- Mana Curve ----------------
|
||||
if (config.computeManaCurve) {
|
||||
manaCurveMap[cmc]++;
|
||||
|
|
@ -105,7 +98,6 @@ void DeckListStatisticsAnalyzer::analyze()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit statsUpdated();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue