mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-03-21 17:55:21 -05:00
* [Cleanup] Unused #includes Took 44 minutes * [Cleanup] More unused #includes Took 55 minutes * [Cleanup] Include QSet Took 4 minutes * [Cleanup] Include QDebug in deck_list.cpp Took 3 minutes * [Cleanup] Include protocol stuff in servatrice_database_interface.h Took 3 minutes * [Cleanup] Include QDialogButtonBox Took 8 minutes * [Cleanup] Include QUrl Took 8 minutes * [Cleanup] Include QTextOption in header. Took 3 minutes * [Cleanup] Include QMap in user_list_manager.h Took 8 minutes * [Cleanup] Adjust qjson Took 8 minutes * [Cleanup] include button box. Took 3 minutes * [Cleanup] Redo fwd declarations. * [Cleanup] Redo last removed fwd declarations. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
30 lines
742 B
C++
30 lines
742 B
C++
/**
|
|
* @file card_info_comparator.h
|
|
* @ingroup Cards
|
|
* @brief TODO: Document this.
|
|
*/
|
|
|
|
#ifndef CARD_INFO_COMPARATOR_H
|
|
#define CARD_INFO_COMPARATOR_H
|
|
|
|
#include "card_info.h"
|
|
|
|
#include <QVariant>
|
|
#include <Qt>
|
|
|
|
class CardInfoComparator
|
|
{
|
|
public:
|
|
explicit CardInfoComparator(const QStringList &properties, Qt::SortOrder order = Qt::AscendingOrder);
|
|
bool operator()(const CardInfoPtr &a, const CardInfoPtr &b) const;
|
|
|
|
private:
|
|
QStringList m_properties; // List of properties to sort by
|
|
Qt::SortOrder m_order;
|
|
|
|
[[nodiscard]] QVariant getProperty(const CardInfoPtr &card, const QString &property) const;
|
|
[[nodiscard]] bool compareVariants(const QVariant &a, const QVariant &b) const;
|
|
};
|
|
|
|
#endif // CARD_INFO_COMPARATOR_H
|