mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 12:03:55 -07:00
* Have CardDatabase::getPreferredPrintingInfo respect card provider ID overrides (pinned printings)
Took 13 minutes
Took 37 seconds
Took 10 seconds
Took 10 seconds
# Commit time for manual adjustment:
# Took 30 seconds
Took 15 seconds
Took 8 minutes
Took 21 seconds
* Move settings cache and settings card preference provider out of libcockatrice_settings and into cockatrice
Took 52 minutes
Took 9 minutes
Took 1 minute
* Temp cache.
Took 16 minutes
* Dependency Injection for SettingsCache
* Turn SettingsCache into a QSharedPointer.
* Implement interfaces for settings that need it
Took 2 hours 38 minutes
* Adjust oracle.
Took 5 minutes
* Move abstract/noop interfaces to libcockatrice_interfaces so they can be linked against independently.
Took 52 minutes
* Clean up some links.
Took 3 minutes
* Cleanup two includes.
Took 3 minutes
* More fixes.
Took 7 minutes
* More includes that slipped past.
Took 3 minutes
* Stop mocking and start injecting for tests.
Took 15 minutes
* I don't know why remote_client was including main.
Took 4 minutes
* Include.
Took 3 minutes
* Lint.
Took 2 minutes
* Don't use Qt pointers.
Took 1 hour 7 minutes
* Make parser use CardSettingsInterface
Took 13 minutes
* Also adjust constructor lol.
Took 8 minutes
* Lint.
Took 32 minutes
* Revert "Lint."
This reverts commit ecb596c39e.
Took 3 minutes
* Test.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
120 lines
2.9 KiB
C++
120 lines
2.9 KiB
C++
#ifndef COCKATRICE_CARD_SET_H
|
|
#define COCKATRICE_CARD_SET_H
|
|
|
|
#include <QDate>
|
|
#include <QList>
|
|
#include <QSharedPointer>
|
|
#include <QString>
|
|
#include <libcockatrice/interfaces/interface_card_set_priority_controller.h>
|
|
|
|
class CardInfo;
|
|
using CardInfoPtr = QSharedPointer<CardInfo>;
|
|
|
|
class CardSet;
|
|
using CardSetPtr = QSharedPointer<CardSet>;
|
|
|
|
class CardSet : public QList<CardInfoPtr>
|
|
{
|
|
public:
|
|
enum Priority
|
|
{
|
|
PriorityFallback = 0,
|
|
PriorityPrimary = 10,
|
|
PrioritySecondary = 20,
|
|
PriorityReprint = 30,
|
|
PriorityOther = 40,
|
|
PriorityLowest = 100,
|
|
};
|
|
|
|
static const char *TOKENS_SETNAME;
|
|
|
|
private:
|
|
QSharedPointer<ICardSetPriorityController> priorityController;
|
|
QString shortName, longName;
|
|
unsigned int sortKey;
|
|
QDate releaseDate;
|
|
QString setType;
|
|
Priority priority;
|
|
bool enabled, isknown;
|
|
|
|
public:
|
|
explicit CardSet(ICardSetPriorityController *priorityController,
|
|
const QString &_shortName = QString(),
|
|
const QString &_longName = QString(),
|
|
const QString &_setType = QString(),
|
|
const QDate &_releaseDate = QDate(),
|
|
const Priority _priority = PriorityFallback);
|
|
|
|
static CardSetPtr newInstance(ICardSetPriorityController *priorityController,
|
|
const QString &_shortName = QString(),
|
|
const QString &_longName = QString(),
|
|
const QString &_setType = QString(),
|
|
const QDate &_releaseDate = QDate(),
|
|
const Priority _priority = PriorityFallback);
|
|
|
|
QString getCorrectedShortName() const;
|
|
|
|
QString getShortName() const
|
|
{
|
|
return shortName;
|
|
}
|
|
QString getLongName() const
|
|
{
|
|
return longName;
|
|
}
|
|
QString getSetType() const
|
|
{
|
|
return setType;
|
|
}
|
|
QDate getReleaseDate() const
|
|
{
|
|
return releaseDate;
|
|
}
|
|
Priority getPriority() const
|
|
{
|
|
return priority;
|
|
}
|
|
|
|
void setLongName(const QString &_longName)
|
|
{
|
|
longName = _longName;
|
|
}
|
|
void setSetType(const QString &_setType)
|
|
{
|
|
setType = _setType;
|
|
}
|
|
void setReleaseDate(const QDate &_releaseDate)
|
|
{
|
|
releaseDate = _releaseDate;
|
|
}
|
|
void setPriority(const Priority _priority)
|
|
{
|
|
priority = _priority;
|
|
}
|
|
|
|
void loadSetOptions();
|
|
int getSortKey() const
|
|
{
|
|
return sortKey;
|
|
}
|
|
void setSortKey(unsigned int _sortKey);
|
|
|
|
bool getEnabled() const
|
|
{
|
|
return enabled;
|
|
}
|
|
void setEnabled(bool _enabled);
|
|
|
|
bool getIsKnown() const
|
|
{
|
|
return isknown;
|
|
}
|
|
void setIsKnown(bool _isknown);
|
|
|
|
bool getIsKnownIgnored() const
|
|
{
|
|
return longName.length() + setType.length() + releaseDate.toString().length() == 0;
|
|
}
|
|
};
|
|
|
|
#endif // COCKATRICE_CARD_SET_H
|