![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <card_list.h>
Public Types | |
| enum | SortOption { NoSort , SortByMainType , SortByManaValue , SortByColorGrouping , SortByName , SortByType , SortByManaCost , SortByColors , SortByPt , SortBySet , SortByPrinting } |
Public Member Functions | |
| CardList (bool _contentsKnown) | |
| CardItem * | findCard (const int cardId) const |
| Finds the CardItem with the given id in the list. If contentsKnown is false, then this just returns the first element of the list. | |
| bool | getContentsKnown () const |
| void | sortBy (const QList< SortOption > &options) |
| sorts the list by using string comparison on properties extracted from the CardItem The cards are compared using each property in order. If two cards have the same value for a property, then the next property in the list is used. | |
Static Public Member Functions | |
| static std::function< QString(CardItem *)> | getExtractorFor (SortOption option) |
| returns the function that extracts the given property from the CardItem. | |
Protected Attributes | |
| bool | contentsKnown |
| enum CardList::SortOption |
|
explicit |
| CardItem * CardList::findCard | ( | const int | cardId | ) | const |
|
inline |
|
static |
returns the function that extracts the given property from the CardItem.
| void CardList::sortBy | ( | const QList< SortOption > & | option | ) |
sorts the list by using string comparison on properties extracted from the CardItem The cards are compared using each property in order. If two cards have the same value for a property, then the next property in the list is used.
| option | the option to compare the cards by, in order of usage. |
|
protected |