mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 17:44:48 -07:00
* Sort *every* file into a doxygen group. Took 7 hours 9 minutes Took 18 seconds Took 2 minutes * Lint some ingroup definitions. Took 10 minutes Took 2 seconds * Just include the groups in the Doxyfile in this commit. Took 3 minutes * Update some group comments so they link! Took 14 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
60 lines
2.3 KiB
C++
60 lines
2.3 KiB
C++
/**
|
|
* @file card_database_querier.h
|
|
* @ingroup CardDatabase
|
|
* @brief The CardDatabaseQuerier is responsible for querying the database and returning data.
|
|
*/
|
|
|
|
#ifndef COCKATRICE_CARD_DATABASE_QUERIER_H
|
|
#define COCKATRICE_CARD_DATABASE_QUERIER_H
|
|
|
|
#include "../card/exact_card.h"
|
|
#include "../common/card_ref.h"
|
|
|
|
#include <QObject>
|
|
|
|
class CardDatabase;
|
|
class CardDatabaseQuerier : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CardDatabaseQuerier(QObject *parent, const CardDatabase *db);
|
|
|
|
[[nodiscard]] CardInfoPtr getCardInfo(const QString &cardName) const;
|
|
[[nodiscard]] QList<CardInfoPtr> getCardInfos(const QStringList &cardNames) const;
|
|
|
|
/*
|
|
* Get a card by its simple name. The name will be simplified in this
|
|
* function, so you don't need to simplify it beforehand.
|
|
*/
|
|
[[nodiscard]] CardInfoPtr getCardBySimpleName(const QString &cardName) const;
|
|
|
|
[[nodiscard]] ExactCard guessCard(const CardRef &cardRef) const;
|
|
[[nodiscard]] ExactCard getCard(const CardRef &cardRef) const;
|
|
[[nodiscard]] QList<ExactCard> getCards(const QList<CardRef> &cardRefs) const;
|
|
|
|
[[nodiscard]] ExactCard getRandomCard() const;
|
|
[[nodiscard]] ExactCard getCardFromSameSet(const QString &cardName, const PrintingInfo &otherPrinting) const;
|
|
|
|
[[nodiscard]] ExactCard getPreferredCard(const CardInfoPtr &card) const;
|
|
[[nodiscard]] bool isPreferredPrinting(const CardRef &cardRef) const;
|
|
[[nodiscard]] PrintingInfo getPreferredPrinting(const CardInfoPtr &card) const;
|
|
[[nodiscard]] PrintingInfo getPreferredPrinting(const QString &cardName) const;
|
|
[[nodiscard]] QString getPreferredPrintingProviderId(const QString &cardName) const;
|
|
|
|
[[nodiscard]] PrintingInfo getSpecificPrinting(const CardRef &cardRef) const;
|
|
[[nodiscard]] PrintingInfo
|
|
getSpecificPrinting(const QString &cardName, const QString &setCode, const QString &collectorNumber) const;
|
|
[[nodiscard]] PrintingInfo findPrintingWithId(const CardInfoPtr &card, const QString &providerId) const;
|
|
|
|
[[nodiscard]] QStringList getAllMainCardTypes() const;
|
|
[[nodiscard]] QMap<QString, int> getAllMainCardTypesWithCount() const;
|
|
[[nodiscard]] QMap<QString, int> getAllSubCardTypesWithCount() const;
|
|
|
|
private:
|
|
const CardDatabase *db;
|
|
|
|
CardInfoPtr lookupCardByName(const QString &name) const;
|
|
};
|
|
|
|
#endif // COCKATRICE_CARD_DATABASE_QUERIER_H
|