mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Dependency inject the card preference provider to satisfy dbconverter mocks.
Took 36 minutes
This commit is contained in:
parent
6939b6d623
commit
fc6ac89098
14 changed files with 62 additions and 10 deletions
|
|
@ -2,11 +2,20 @@
|
|||
#define MAIN_H
|
||||
|
||||
#include "../../cockatrice/src/database/card_database.h"
|
||||
#include "../../cockatrice/src/database/interface/noop_card_preference_provider.h"
|
||||
#include "../../cockatrice/src/database/parser/cockatrice_xml_4.h"
|
||||
|
||||
class CardDatabaseConverter : public CardDatabase
|
||||
{
|
||||
public:
|
||||
explicit CardDatabaseConverter()
|
||||
{
|
||||
// Replace querier with one that ignores SettingsCache
|
||||
delete querier;
|
||||
querier = new CardDatabaseQuerier(this, this,
|
||||
std::make_shared<NoopCardPreferenceProvider>());
|
||||
};
|
||||
|
||||
LoadStatus loadCardDatabase(const QString &path)
|
||||
{
|
||||
return loader->loadCardDatabase(path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue