mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[Refactor] Untangle card_info.cpp and split into individual files. (#6202)
* Untangle the card_info.cpp mess and split into individual files. Took 53 minutes * Auto-lint was disabled and my pre-commit hook didn't fire. Oh well. Took 3 minutes * Fix oracle. Took 35 seconds * Lint! Took 20 seconds * Fix tests. Took 3 minutes * CMakeLists.txt: The reason why I have to disable auto-lint. Took 2 minutes * dbconverter. Took 3 minutes * Oracle again. Took 3 minutes * dbconverter again. Took 3 minutes * dbconverter again again. Took 2 minutes * More fixes. Took 4 minutes Took 21 seconds * Everything needs everything. Took 3 minutes * Everything means everything. Took 4 minutes * All the tests. Took 4 minutes * I hate everything about this. Took 3 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
835e4af3e4
commit
89a8d0f6b8
30 changed files with 743 additions and 516 deletions
|
|
@ -18,6 +18,9 @@ set(oracle_SOURCES
|
|||
src/parsehelpers.cpp
|
||||
src/qt-json/json.cpp
|
||||
../cockatrice/src/card/card_info.cpp
|
||||
../cockatrice/src/card/card_relation.cpp
|
||||
../cockatrice/src/card/card_set.cpp
|
||||
../cockatrice/src/card/printing_info.cpp
|
||||
../cockatrice/src/client/network/release_channel.cpp
|
||||
../cockatrice/src/database/parser/card_database_parser.cpp
|
||||
../cockatrice/src/database/parser/cockatrice_xml_3.cpp
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <QDebug>
|
||||
#include <QRegularExpression>
|
||||
#include <algorithm>
|
||||
#include <card/card_relation.h>
|
||||
#include <climits>
|
||||
|
||||
SplitCardPart::SplitCardPart(const QString &_name,
|
||||
|
|
@ -379,12 +380,12 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
|||
static const QRegularExpression meldNameRegex{"then meld them into ([^\\.]*)"};
|
||||
QString additionalName = meldNameRegex.match(text).captured(1);
|
||||
if (!additionalName.isNull()) {
|
||||
relatedCards.append(new CardRelation(additionalName, CardRelation::TransformInto));
|
||||
relatedCards.append(new CardRelation(additionalName, CardRelationType::TransformInto));
|
||||
}
|
||||
} else {
|
||||
for (const QString &additionalName : name.split(" // ")) {
|
||||
if (additionalName != faceName) {
|
||||
relatedCards.append(new CardRelation(additionalName, CardRelation::TransformInto));
|
||||
relatedCards.append(new CardRelation(additionalName, CardRelationType::TransformInto));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -399,7 +400,7 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
|||
auto spbk = givenRelated.value("spellbook").toStringList();
|
||||
for (const QString &spbkName : spbk) {
|
||||
relatedCards.append(
|
||||
new CardRelation(spbkName, CardRelation::DoesNotAttach, false, false, 1, true));
|
||||
new CardRelation(spbkName, CardRelationType::DoesNotAttach, false, false, 1, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue