mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
rename again
This commit is contained in:
parent
37adf1794d
commit
47434c64ee
13 changed files with 34 additions and 34 deletions
|
|
@ -224,8 +224,8 @@ void PrintingSelector::getAllSetsForCurrentCard()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintingInfoPerSetMap perSetMap = selectedCard->getSets();
|
SetToPrintingsMap setMap = selectedCard->getSets();
|
||||||
const QList<PrintingInfo> sortedPrintings = sortToolBar->sortSets(perSetMap);
|
const QList<PrintingInfo> sortedPrintings = sortToolBar->sortSets(setMap);
|
||||||
const QList<PrintingInfo> filteredPrintings =
|
const QList<PrintingInfo> filteredPrintings =
|
||||||
sortToolBar->filterSets(sortedPrintings, searchBar->getSearchText().trimmed().toLower());
|
sortToolBar->filterSets(sortedPrintings, searchBar->getSearchText().trimmed().toLower());
|
||||||
QList<PrintingInfo> printingsToUse;
|
QList<PrintingInfo> printingsToUse;
|
||||||
|
|
|
||||||
|
|
@ -73,14 +73,14 @@ void PrintingSelectorCardSortingWidget::updateSortSetting()
|
||||||
* - Contained in Deck
|
* - Contained in Deck
|
||||||
* - Potential Cards in Deck
|
* - Potential Cards in Deck
|
||||||
*
|
*
|
||||||
* @param perSetMap The list of card sets to be sorted.
|
* @param setMap The list of card sets to be sorted.
|
||||||
* @return A sorted list of printings.
|
* @return A sorted list of printings.
|
||||||
*/
|
*/
|
||||||
QList<PrintingInfo> PrintingSelectorCardSortingWidget::sortSets(const PrintingInfoPerSetMap &perSetMap)
|
QList<PrintingInfo> PrintingSelectorCardSortingWidget::sortSets(const SetToPrintingsMap &setMap)
|
||||||
{
|
{
|
||||||
QList<CardSetPtr> sortedSets;
|
QList<CardSetPtr> sortedSets;
|
||||||
|
|
||||||
for (const auto &printingInfos : perSetMap) {
|
for (const auto &printingInfos : setMap) {
|
||||||
for (const auto &set : printingInfos) {
|
for (const auto &set : printingInfos) {
|
||||||
sortedSets << set.getSet();
|
sortedSets << set.getSet();
|
||||||
break;
|
break;
|
||||||
|
|
@ -101,7 +101,7 @@ QList<PrintingInfo> PrintingSelectorCardSortingWidget::sortSets(const PrintingIn
|
||||||
QList<PrintingInfo> sortedPrintings;
|
QList<PrintingInfo> sortedPrintings;
|
||||||
// Reconstruct sorted list of CardInfoPerSet
|
// Reconstruct sorted list of CardInfoPerSet
|
||||||
for (const auto &set : sortedSets) {
|
for (const auto &set : sortedSets) {
|
||||||
for (auto it = perSetMap.begin(); it != perSetMap.end(); ++it) {
|
for (auto it = setMap.begin(); it != setMap.end(); ++it) {
|
||||||
for (const auto &cardInfoPerSet : it.value()) {
|
for (const auto &cardInfoPerSet : it.value()) {
|
||||||
if (cardInfoPerSet.getSet() == set) {
|
if (cardInfoPerSet.getSet() == set) {
|
||||||
if (!sortedPrintings.contains(cardInfoPerSet)) {
|
if (!sortedPrintings.contains(cardInfoPerSet)) {
|
||||||
|
|
@ -188,11 +188,11 @@ QList<PrintingInfo> PrintingSelectorCardSortingWidget::prependPrintingsInDeck(co
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintingInfoPerSetMap perSetMap = selectedCard->getSets();
|
SetToPrintingsMap setMap = selectedCard->getSets();
|
||||||
QList<QPair<PrintingInfo, int>> countList;
|
QList<QPair<PrintingInfo, int>> countList;
|
||||||
|
|
||||||
// Collect sets with their counts
|
// Collect sets with their counts
|
||||||
for (const auto &printingList : perSetMap) {
|
for (const auto &printingList : setMap) {
|
||||||
for (const auto &printing : printingList) {
|
for (const auto &printing : printingList) {
|
||||||
QModelIndex find_card =
|
QModelIndex find_card =
|
||||||
deckModel->findCard(selectedCard->getName(), DECK_ZONE_MAIN, printing.getProperty("uuid"));
|
deckModel->findCard(selectedCard->getName(), DECK_ZONE_MAIN, printing.getProperty("uuid"));
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class PrintingSelectorCardSortingWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit PrintingSelectorCardSortingWidget(PrintingSelector *parent);
|
explicit PrintingSelectorCardSortingWidget(PrintingSelector *parent);
|
||||||
QList<PrintingInfo> sortSets(const PrintingInfoPerSetMap &perSetMap);
|
QList<PrintingInfo> sortSets(const SetToPrintingsMap &setMap);
|
||||||
QList<PrintingInfo> filterSets(const QList<PrintingInfo> &printings, const QString &searchText);
|
QList<PrintingInfo> filterSets(const QList<PrintingInfo> &printings, const QString &searchText);
|
||||||
QList<PrintingInfo> prependPinnedPrintings(const QList<PrintingInfo> &printings, const QString &cardName);
|
QList<PrintingInfo> prependPinnedPrintings(const QList<PrintingInfo> &printings, const QString &cardName);
|
||||||
QList<PrintingInfo> prependPrintingsInDeck(const QList<PrintingInfo> &printings,
|
QList<PrintingInfo> prependPrintingsInDeck(const QList<PrintingInfo> &printings,
|
||||||
|
|
|
||||||
|
|
@ -230,7 +230,7 @@ void VisualDatabaseDisplayWidget::populateCards()
|
||||||
|
|
||||||
if (CardInfoPtr info = CardDatabaseManager::getInstance()->getCard(name.toString())) {
|
if (CardInfoPtr info = CardDatabaseManager::getInstance()->getCard(name.toString())) {
|
||||||
if (setFilter) {
|
if (setFilter) {
|
||||||
PrintingInfoPerSetMap setMap = info->getSets();
|
SetToPrintingsMap setMap = info->getSets();
|
||||||
if (setMap.contains(setFilter->term())) {
|
if (setMap.contains(setFilter->term())) {
|
||||||
for (PrintingInfo printing : setMap[setFilter->term()]) {
|
for (PrintingInfo printing : setMap[setFilter->term()]) {
|
||||||
addCard(CardDatabaseManager::getInstance()->getCardByNameAndProviderId(
|
addCard(CardDatabaseManager::getInstance()->getCardByNameAndProviderId(
|
||||||
|
|
@ -296,7 +296,7 @@ void VisualDatabaseDisplayWidget::loadNextPage()
|
||||||
QVariant name = databaseDisplayModel->data(index, Qt::DisplayRole);
|
QVariant name = databaseDisplayModel->data(index, Qt::DisplayRole);
|
||||||
if (CardInfoPtr info = CardDatabaseManager::getInstance()->getCard(name.toString())) {
|
if (CardInfoPtr info = CardDatabaseManager::getInstance()->getCard(name.toString())) {
|
||||||
if (setFilter) {
|
if (setFilter) {
|
||||||
PrintingInfoPerSetMap setMap = info->getSets();
|
SetToPrintingsMap setMap = info->getSets();
|
||||||
if (setMap.contains(setFilter->term())) {
|
if (setMap.contains(setFilter->term())) {
|
||||||
for (PrintingInfo printing : setMap[setFilter->term()]) {
|
for (PrintingInfo printing : setMap[setFilter->term()]) {
|
||||||
addCard(CardDatabaseManager::getInstance()->getCardByNameAndProviderId(
|
addCard(CardDatabaseManager::getInstance()->getCardByNameAndProviderId(
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ void DlgEditTokens::actAddToken()
|
||||||
}
|
}
|
||||||
|
|
||||||
QString setName = CardSet::TOKENS_SETNAME;
|
QString setName = CardSet::TOKENS_SETNAME;
|
||||||
PrintingInfoPerSetMap sets;
|
SetToPrintingsMap sets;
|
||||||
sets[setName].append(PrintingInfo(databaseModel->getDatabase()->getSet(setName)));
|
sets[setName].append(PrintingInfo(databaseModel->getDatabase()->getSet(setName)));
|
||||||
CardInfoPtr card = CardInfo::newInstance(name, "", true, QVariantHash(), QList<CardRelation *>(),
|
CardInfoPtr card = CardInfo::newInstance(name, "", true, QVariantHash(), QList<CardRelation *>(),
|
||||||
QList<CardRelation *>(), sets, false, false, -1, false);
|
QList<CardRelation *>(), sets, false, false, -1, false);
|
||||||
|
|
|
||||||
|
|
@ -226,8 +226,8 @@ QMap<QString, int> DlgSelectSetForCards::getSetsForCards()
|
||||||
if (!infoPtr)
|
if (!infoPtr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
PrintingInfoPerSetMap perSetMap = infoPtr->getSets();
|
SetToPrintingsMap setMap = infoPtr->getSets();
|
||||||
for (auto it = perSetMap.begin(); it != perSetMap.end(); ++it) {
|
for (auto it = setMap.begin(); it != setMap.end(); ++it) {
|
||||||
setCounts[it.key()]++;
|
setCounts[it.key()]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -380,8 +380,8 @@ QMap<QString, QStringList> DlgSelectSetForCards::getCardsForSets()
|
||||||
if (!infoPtr)
|
if (!infoPtr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
PrintingInfoPerSetMap perSetMap = infoPtr->getSets();
|
SetToPrintingsMap setMap = infoPtr->getSets();
|
||||||
for (auto it = perSetMap.begin(); it != perSetMap.end(); ++it) {
|
for (auto it = setMap.begin(); it != setMap.end(); ++it) {
|
||||||
setCards[it.key()].append(currentCard->getName());
|
setCards[it.key()].append(currentCard->getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ void AbstractCardItem::refreshCardInfo()
|
||||||
QVariantHash properties = QVariantHash();
|
QVariantHash properties = QVariantHash();
|
||||||
|
|
||||||
info = CardInfo::newInstance(name, "", true, QVariantHash(), QList<CardRelation *>(), QList<CardRelation *>(),
|
info = CardInfo::newInstance(name, "", true, QVariantHash(), QList<CardRelation *>(), QList<CardRelation *>(),
|
||||||
PrintingInfoPerSetMap(), false, false, -1, false);
|
SetToPrintingsMap(), false, false, -1, false);
|
||||||
}
|
}
|
||||||
if (info.data()) {
|
if (info.data()) {
|
||||||
connect(info.data(), &CardInfo::pixmapUpdated, this, &AbstractCardItem::pixmapUpdated);
|
connect(info.data(), &CardInfo::pixmapUpdated, this, &AbstractCardItem::pixmapUpdated);
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,7 @@ PrintingInfo CardDatabase::getPreferredPrinting(const QString &cardName) const
|
||||||
return PrintingInfo(nullptr);
|
return PrintingInfo(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintingInfoPerSetMap setMap = cardInfo->getSets();
|
SetToPrintingsMap setMap = cardInfo->getSets();
|
||||||
if (setMap.empty()) {
|
if (setMap.empty()) {
|
||||||
return PrintingInfo(nullptr);
|
return PrintingInfo(nullptr);
|
||||||
}
|
}
|
||||||
|
|
@ -349,7 +349,7 @@ PrintingInfo CardDatabase::getSpecificPrinting(const QString &cardName, const QS
|
||||||
return PrintingInfo(nullptr);
|
return PrintingInfo(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintingInfoPerSetMap setMap = cardInfo->getSets();
|
SetToPrintingsMap setMap = cardInfo->getSets();
|
||||||
if (setMap.empty()) {
|
if (setMap.empty()) {
|
||||||
return PrintingInfo(nullptr);
|
return PrintingInfo(nullptr);
|
||||||
}
|
}
|
||||||
|
|
@ -378,7 +378,7 @@ PrintingInfo CardDatabase::getSpecificPrinting(const QString &cardName,
|
||||||
return PrintingInfo(nullptr);
|
return PrintingInfo(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintingInfoPerSetMap setMap = cardInfo->getSets();
|
SetToPrintingsMap setMap = cardInfo->getSets();
|
||||||
if (setMap.empty()) {
|
if (setMap.empty()) {
|
||||||
return PrintingInfo(nullptr);
|
return PrintingInfo(nullptr);
|
||||||
}
|
}
|
||||||
|
|
@ -426,7 +426,7 @@ bool CardDatabase::isProviderIdForPreferredPrinting(const QString &cardName, con
|
||||||
|
|
||||||
PrintingInfo CardDatabase::getSetInfoForCard(const CardInfoPtr &_card)
|
PrintingInfo CardDatabase::getSetInfoForCard(const CardInfoPtr &_card)
|
||||||
{
|
{
|
||||||
const PrintingInfoPerSetMap &setMap = _card->getSets();
|
const SetToPrintingsMap &setMap = _card->getSets();
|
||||||
if (setMap.empty()) {
|
if (setMap.empty()) {
|
||||||
return PrintingInfo(nullptr);
|
return PrintingInfo(nullptr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
||||||
QVariantHash properties = QVariantHash();
|
QVariantHash properties = QVariantHash();
|
||||||
QString colors = QString("");
|
QString colors = QString("");
|
||||||
QList<CardRelation *> relatedCards, reverseRelatedCards;
|
QList<CardRelation *> relatedCards, reverseRelatedCards;
|
||||||
auto _sets = PrintingInfoPerSetMap();
|
auto _sets = SetToPrintingsMap();
|
||||||
int tableRow = 0;
|
int tableRow = 0;
|
||||||
bool cipt = false;
|
bool cipt = false;
|
||||||
bool landscapeOrientation = false;
|
bool landscapeOrientation = false;
|
||||||
|
|
@ -343,8 +343,8 @@ static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfoPtr &in
|
||||||
}
|
}
|
||||||
|
|
||||||
// sets
|
// sets
|
||||||
const PrintingInfoPerSetMap perSetMap = info->getSets();
|
const SetToPrintingsMap setMap = info->getSets();
|
||||||
for (const auto &printings : perSetMap) {
|
for (const auto &printings : setMap) {
|
||||||
for (const PrintingInfo &set : printings) {
|
for (const PrintingInfo &set : printings) {
|
||||||
xml.writeStartElement("set");
|
xml.writeStartElement("set");
|
||||||
xml.writeAttribute("rarity", set.getProperty("rarity"));
|
xml.writeAttribute("rarity", set.getProperty("rarity"));
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ void CockatriceXml4Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
||||||
QString text = QString("");
|
QString text = QString("");
|
||||||
QVariantHash properties = QVariantHash();
|
QVariantHash properties = QVariantHash();
|
||||||
QList<CardRelation *> relatedCards, reverseRelatedCards;
|
QList<CardRelation *> relatedCards, reverseRelatedCards;
|
||||||
auto _sets = PrintingInfoPerSetMap();
|
auto _sets = SetToPrintingsMap();
|
||||||
int tableRow = 0;
|
int tableRow = 0;
|
||||||
bool cipt = false;
|
bool cipt = false;
|
||||||
bool landscapeOrientation = false;
|
bool landscapeOrientation = false;
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ CardInfo::CardInfo(const QString &_name,
|
||||||
QVariantHash _properties,
|
QVariantHash _properties,
|
||||||
const QList<CardRelation *> &_relatedCards,
|
const QList<CardRelation *> &_relatedCards,
|
||||||
const QList<CardRelation *> &_reverseRelatedCards,
|
const QList<CardRelation *> &_reverseRelatedCards,
|
||||||
PrintingInfoPerSetMap _sets,
|
SetToPrintingsMap _sets,
|
||||||
bool _cipt,
|
bool _cipt,
|
||||||
bool _landscapeOrientation,
|
bool _landscapeOrientation,
|
||||||
int _tableRow,
|
int _tableRow,
|
||||||
|
|
@ -248,7 +248,7 @@ CardInfo::~CardInfo()
|
||||||
CardInfoPtr CardInfo::newInstance(const QString &_name)
|
CardInfoPtr CardInfo::newInstance(const QString &_name)
|
||||||
{
|
{
|
||||||
return newInstance(_name, QString(), false, QVariantHash(), QList<CardRelation *>(), QList<CardRelation *>(),
|
return newInstance(_name, QString(), false, QVariantHash(), QList<CardRelation *>(), QList<CardRelation *>(),
|
||||||
PrintingInfoPerSetMap(), false, false, 0, false);
|
SetToPrintingsMap(), false, false, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
CardInfoPtr CardInfo::newInstance(const QString &_name,
|
CardInfoPtr CardInfo::newInstance(const QString &_name,
|
||||||
|
|
@ -257,7 +257,7 @@ CardInfoPtr CardInfo::newInstance(const QString &_name,
|
||||||
QVariantHash _properties,
|
QVariantHash _properties,
|
||||||
const QList<CardRelation *> &_relatedCards,
|
const QList<CardRelation *> &_relatedCards,
|
||||||
const QList<CardRelation *> &_reverseRelatedCards,
|
const QList<CardRelation *> &_reverseRelatedCards,
|
||||||
PrintingInfoPerSetMap _sets,
|
SetToPrintingsMap _sets,
|
||||||
bool _cipt,
|
bool _cipt,
|
||||||
bool _landscapeOrientation,
|
bool _landscapeOrientation,
|
||||||
int _tableRow,
|
int _tableRow,
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ class ICardDatabaseParser;
|
||||||
|
|
||||||
typedef QSharedPointer<CardInfo> CardInfoPtr;
|
typedef QSharedPointer<CardInfo> CardInfoPtr;
|
||||||
typedef QSharedPointer<CardSet> CardSetPtr;
|
typedef QSharedPointer<CardSet> CardSetPtr;
|
||||||
typedef QMap<QString, QList<PrintingInfo>> PrintingInfoPerSetMap;
|
typedef QMap<QString, QList<PrintingInfo>> SetToPrintingsMap;
|
||||||
|
|
||||||
typedef QHash<QString, CardInfoPtr> CardNameMap;
|
typedef QHash<QString, CardInfoPtr> CardNameMap;
|
||||||
typedef QHash<QString, CardSetPtr> SetNameMap;
|
typedef QHash<QString, CardSetPtr> SetNameMap;
|
||||||
|
|
@ -204,7 +204,7 @@ private:
|
||||||
// the cards thare are reverse-related to me
|
// the cards thare are reverse-related to me
|
||||||
QList<CardRelation *> reverseRelatedCardsToMe;
|
QList<CardRelation *> reverseRelatedCardsToMe;
|
||||||
// card sets
|
// card sets
|
||||||
PrintingInfoPerSetMap sets;
|
SetToPrintingsMap sets;
|
||||||
// cached set names
|
// cached set names
|
||||||
QString setsNames;
|
QString setsNames;
|
||||||
// positioning properties; used by UI
|
// positioning properties; used by UI
|
||||||
|
|
@ -220,7 +220,7 @@ public:
|
||||||
QVariantHash _properties,
|
QVariantHash _properties,
|
||||||
const QList<CardRelation *> &_relatedCards,
|
const QList<CardRelation *> &_relatedCards,
|
||||||
const QList<CardRelation *> &_reverseRelatedCards,
|
const QList<CardRelation *> &_reverseRelatedCards,
|
||||||
PrintingInfoPerSetMap _sets,
|
SetToPrintingsMap _sets,
|
||||||
bool _cipt,
|
bool _cipt,
|
||||||
bool _landscapeOrientation,
|
bool _landscapeOrientation,
|
||||||
int _tableRow,
|
int _tableRow,
|
||||||
|
|
@ -243,7 +243,7 @@ public:
|
||||||
QVariantHash _properties,
|
QVariantHash _properties,
|
||||||
const QList<CardRelation *> &_relatedCards,
|
const QList<CardRelation *> &_relatedCards,
|
||||||
const QList<CardRelation *> &_reverseRelatedCards,
|
const QList<CardRelation *> &_reverseRelatedCards,
|
||||||
PrintingInfoPerSetMap _sets,
|
SetToPrintingsMap _sets,
|
||||||
bool _cipt,
|
bool _cipt,
|
||||||
bool _landscapeOrientation,
|
bool _landscapeOrientation,
|
||||||
int _tableRow,
|
int _tableRow,
|
||||||
|
|
@ -311,7 +311,7 @@ public:
|
||||||
{
|
{
|
||||||
return properties.contains(propertyName);
|
return properties.contains(propertyName);
|
||||||
}
|
}
|
||||||
const PrintingInfoPerSetMap &getSets() const
|
const SetToPrintingsMap &getSets() const
|
||||||
{
|
{
|
||||||
return sets;
|
return sets;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ CardInfoPtr OracleImporter::addCard(QString name,
|
||||||
|
|
||||||
// insert the card and its properties
|
// insert the card and its properties
|
||||||
QList<CardRelation *> reverseRelatedCards;
|
QList<CardRelation *> reverseRelatedCards;
|
||||||
PrintingInfoPerSetMap setsInfo;
|
SetToPrintingsMap setsInfo;
|
||||||
setsInfo[printingInfo.getSet()->getShortName()].append(printingInfo);
|
setsInfo[printingInfo.getSet()->getShortName()].append(printingInfo);
|
||||||
CardInfoPtr newCard = CardInfo::newInstance(name, text, isToken, properties, relatedCards, reverseRelatedCards,
|
CardInfoPtr newCard = CardInfo::newInstance(name, text, isToken, properties, relatedCards, reverseRelatedCards,
|
||||||
setsInfo, cipt, landscapeOrientation, tableRow, upsideDown);
|
setsInfo, cipt, landscapeOrientation, tableRow, upsideDown);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue