mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-29 12:20:24 -07:00
* [Card Database] Improve loading times through binary cache Took 10 minutes Took 9 minutes Took 16 seconds * [Card Database] Remove lib qt include Took 18 minutes Took 14 seconds * Downgrade to 6.3 datastream Took 5 minutes * go up to 6.4 datastream Took 1 minute * Address comments * Small bug fixes Took 20 minutes Took 10 seconds * More fixes. Took 4 minutes Took 4 seconds * Even more fixes. Took 11 minutes Took 4 seconds * More fixes. Took 6 minutes Took 26 seconds Took 8 minutes * Namespace instead of class Took 6 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
#include "card_database_parser.h"
|
|
|
|
#include <libcockatrice/interfaces/noop_card_set_priority_controller.h>
|
|
|
|
SetNameMap ICardDatabaseParser::sets;
|
|
|
|
ICardDatabaseParser::ICardDatabaseParser(ICardSetPriorityController *_cardSetPriorityController)
|
|
: cardSetPriorityController(_cardSetPriorityController)
|
|
{
|
|
}
|
|
void ICardDatabaseParser::clearSetlist()
|
|
{
|
|
sets.clear();
|
|
}
|
|
|
|
CardSetPtr ICardDatabaseParser::internalAddSet(const QString &setName,
|
|
const QString &longName,
|
|
const QString &setType,
|
|
const QDate &releaseDate,
|
|
const CardSet::Priority priority)
|
|
{
|
|
if (sets.contains(setName)) {
|
|
return sets.value(setName);
|
|
}
|
|
|
|
CardSetPtr newSet = CardSet::newInstance(cardSetPriorityController, setName);
|
|
newSet->setLongName(longName);
|
|
newSet->setSetType(setType);
|
|
newSet->setReleaseDate(releaseDate);
|
|
newSet->setPriority(priority);
|
|
|
|
sets.insert(setName, newSet);
|
|
if (targetData) {
|
|
targetData->sets.insert(setName, newSet);
|
|
} else {
|
|
emit addSet(newSet);
|
|
}
|
|
return newSet;
|
|
}
|