mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 10:04:46 -07:00
Clang-format (#3028)
* 1/3 Add .clang-format file and travis compilation check * 2/3 Run clang-format * 3/3 Fix compilation problems due to include reordering * 3bis/3 AfterControlStatement: false
This commit is contained in:
parent
8dbdd24c8e
commit
b29bd9e070
272 changed files with 13378 additions and 9535 deletions
|
|
@ -6,60 +6,93 @@
|
|||
|
||||
#include <carddatabase.h>
|
||||
|
||||
class SetToDownload {
|
||||
class SetToDownload
|
||||
{
|
||||
private:
|
||||
QString shortName, longName;
|
||||
QVariant cards;
|
||||
QDate releaseDate;
|
||||
QString setType;
|
||||
|
||||
public:
|
||||
const QString &getShortName() const { return shortName; }
|
||||
const QString &getLongName() const { return longName; }
|
||||
const QVariant &getCards() const { return cards; }
|
||||
const QString &getSetType() const { return setType; }
|
||||
const QDate &getReleaseDate() const { return releaseDate; }
|
||||
SetToDownload(const QString &_shortName, const QString &_longName, const QVariant &_cards, const QString &_setType = QString(), const QDate &_releaseDate = QDate())
|
||||
: shortName(_shortName), longName(_longName), cards(_cards), releaseDate(_releaseDate), setType(_setType) { }
|
||||
bool operator<(const SetToDownload &set) const { return longName.compare(set.longName, Qt::CaseInsensitive) < 0; }
|
||||
const QString &getShortName() const
|
||||
{
|
||||
return shortName;
|
||||
}
|
||||
const QString &getLongName() const
|
||||
{
|
||||
return longName;
|
||||
}
|
||||
const QVariant &getCards() const
|
||||
{
|
||||
return cards;
|
||||
}
|
||||
const QString &getSetType() const
|
||||
{
|
||||
return setType;
|
||||
}
|
||||
const QDate &getReleaseDate() const
|
||||
{
|
||||
return releaseDate;
|
||||
}
|
||||
SetToDownload(const QString &_shortName,
|
||||
const QString &_longName,
|
||||
const QVariant &_cards,
|
||||
const QString &_setType = QString(),
|
||||
const QDate &_releaseDate = QDate())
|
||||
: shortName(_shortName), longName(_longName), cards(_cards), releaseDate(_releaseDate), setType(_setType)
|
||||
{
|
||||
}
|
||||
bool operator<(const SetToDownload &set) const
|
||||
{
|
||||
return longName.compare(set.longName, Qt::CaseInsensitive) < 0;
|
||||
}
|
||||
};
|
||||
|
||||
class OracleImporter : public CardDatabase {
|
||||
class OracleImporter : public CardDatabase
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QList<SetToDownload> allSets;
|
||||
QVariantMap setsMap;
|
||||
QString dataDir;
|
||||
|
||||
CardInfo *addCard(
|
||||
const QString &setName,
|
||||
QString cardName,
|
||||
bool isToken,
|
||||
int cardId,
|
||||
QString &setNumber,
|
||||
QString &cardCost,
|
||||
QString &cmc,
|
||||
const QString &cardType,
|
||||
const QString &cardPT,
|
||||
int cardLoyalty,
|
||||
const QString &cardText,
|
||||
const QStringList & colors,
|
||||
const QList<CardRelation *> & relatedCards,
|
||||
const QList<CardRelation *> & reverseRelatedCards,
|
||||
bool upsideDown,
|
||||
QString &rarity
|
||||
);
|
||||
|
||||
CardInfo *addCard(const QString &setName,
|
||||
QString cardName,
|
||||
bool isToken,
|
||||
int cardId,
|
||||
QString &setNumber,
|
||||
QString &cardCost,
|
||||
QString &cmc,
|
||||
const QString &cardType,
|
||||
const QString &cardPT,
|
||||
int cardLoyalty,
|
||||
const QString &cardText,
|
||||
const QStringList &colors,
|
||||
const QList<CardRelation *> &relatedCards,
|
||||
const QList<CardRelation *> &reverseRelatedCards,
|
||||
bool upsideDown,
|
||||
QString &rarity);
|
||||
signals:
|
||||
void setIndexChanged(int cardsImported, int setIndex, const QString &setName);
|
||||
void dataReadProgress(int bytesRead, int totalBytes);
|
||||
|
||||
public:
|
||||
OracleImporter(const QString &_dataDir, QObject *parent = 0);
|
||||
bool readSetsFromByteArray(const QByteArray &data);
|
||||
int startImport();
|
||||
int importTextSpoiler(CardSet *set, const QVariant &data);
|
||||
QList<SetToDownload> &getSets() { return allSets; }
|
||||
const QString &getDataDir() const { return dataDir; }
|
||||
QList<SetToDownload> &getSets()
|
||||
{
|
||||
return allSets;
|
||||
}
|
||||
const QString &getDataDir() const
|
||||
{
|
||||
return dataDir;
|
||||
}
|
||||
|
||||
protected:
|
||||
void extractColors(const QStringList & in, QStringList & out);
|
||||
void extractColors(const QStringList &in, QStringList &out);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue