mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-22 10:22:15 -07:00
Added Zach's work on storing printing information in the DeckList (#1)
* Change CardInfo's PixmapCacheKey to be the UUID of the preferred set after database loading has finished. Otherwise, and if no UUID of a preferred set is available, default to the card name. * Refactor CardDatabase *db global variable to singleton CardDatabaseManager. This commit refactors the global variable CardDatabase *db into a singleton encapsulated by the DatabaseManager class, accessible via DatabaseManager::getInstance(). This change centralizes access to the database instance, improving code modularity and encapsulation, resolving dependencies on main.h for code that requires access to the database instance. - Added DatabaseManager class with getInstance() method returning a pointer to the singleton CardDatabase. - Removed global db variable and updated references across the codebase. - Thread-safe static initialization for the singleton. Impact: This refactor should have no functional impact on the application, as it maintains the same interface for accessing the CardDatabase instance. However, the codebase now benefits from improved encapsulation, lifetime management, and thread-safety. * fixed db issue an renamed sets to set in picture loader * canibalized zach work and added it to the decklist builder --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
c2ae31b3b8
commit
502c901c06
3 changed files with 96 additions and 15 deletions
|
|
@ -37,6 +37,22 @@ public:
|
|||
{
|
||||
dataNode->setName(_name);
|
||||
}
|
||||
QString getCardUuid() const override
|
||||
{
|
||||
return dataNode->getCardUuid();
|
||||
}
|
||||
void setCardSetCode(const QString &_cardSetName) override
|
||||
{
|
||||
dataNode->setCardSetCode(_cardSetName);
|
||||
}
|
||||
QString getCardCollectorNumber() const override
|
||||
{
|
||||
return dataNode->getCardCollectorNumber();
|
||||
}
|
||||
void setCardCollectorNumber(const QString &_cardSetNumber) override
|
||||
{
|
||||
dataNode->setCardCollectorNumber(_cardSetNumber);
|
||||
}
|
||||
DecklistCardNode *getDataNode() const
|
||||
{
|
||||
return dataNode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue