mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-23 23:23:55 -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>
55 lines
1.1 KiB
C++
55 lines
1.1 KiB
C++
/**
|
|
* @file card_list.h
|
|
* @ingroup GameLogicCards
|
|
* @brief TODO: Document this.
|
|
*/
|
|
|
|
#ifndef CARDLIST_H
|
|
#define CARDLIST_H
|
|
|
|
#include <QList>
|
|
#include <QLoggingCategory>
|
|
|
|
inline Q_LOGGING_CATEGORY(CardListLog, "card_list");
|
|
|
|
class CardItem;
|
|
|
|
class CardList : public QList<CardItem *>
|
|
{
|
|
protected:
|
|
bool contentsKnown;
|
|
|
|
public:
|
|
enum SortOption
|
|
{
|
|
NoSort,
|
|
|
|
// Options that are used by groupBy
|
|
// Should partition all cards into a reasonable number of buckets
|
|
SortByMainType,
|
|
SortByManaValue,
|
|
SortByColorGrouping,
|
|
|
|
// Options that are used by sortBy
|
|
// We don't care about buckets; we want as many distinct values as possible.
|
|
SortByName,
|
|
SortByType,
|
|
SortByManaCost,
|
|
SortByColors,
|
|
SortByPt,
|
|
SortBySet,
|
|
SortByPrinting
|
|
};
|
|
explicit CardList(bool _contentsKnown);
|
|
CardItem *findCard(const int cardId) const;
|
|
bool getContentsKnown() const
|
|
{
|
|
return contentsKnown;
|
|
}
|
|
|
|
void sortBy(const QList<SortOption> &options);
|
|
|
|
static std::function<QString(CardItem *)> getExtractorFor(SortOption option);
|
|
};
|
|
|
|
#endif
|