![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
A list-like container for CardSet objects with extended management methods. More...
#include <card_set_list.h>
Classes | |
| class | KeyCompareFunctor |
| Internal comparison functor for sorting by sort key. More... | |
Public Member Functions | |
| void | sortByKey () |
| Sorts the set list by each set’s assigned sort key. | |
| void | enableAllBatched (ICardSetPriorityController *controller) |
| Enables every set with fresh sort keys, persisting in one flush. | |
| void | enableAllUnknownBatched (ICardSetPriorityController *controller) |
| Enables all sets that are unknown or ignored, persisting in one flush. | |
| void | markAllAsKnownBatched (ICardSetPriorityController *controller) |
| Marks all sets as known and adjusts their enabled state, persisting in one flush. | |
| int | getEnabledSetsNum () |
| Counts the number of sets that are currently enabled. | |
| int | getUnknownSetsNum () |
| Counts the number of sets that are currently unknown. | |
| QStringList | getUnknownSetsNames () |
| Collects the short names of all sets marked as unknown. | |
| void | defaultSort () |
| Sorts the list by default rules. | |
A list-like container for CardSet objects with extended management methods.
Extends QList<CardSetPtr> by adding convenience operations for sorting, enabling/disabling sets, and tracking known/unknown status. Unlike a plain list, this container provides domain-specific functionality for handling groups of sets in bulk.
| void CardSetList::defaultSort | ( | ) |
Sorts the list by default rules.
Orders sets first by priority (ascending), then by release date (most recent first), and finally alphabetically by short name.
| void CardSetList::enableAllBatched | ( | ICardSetPriorityController * | controller | ) |
Enables every set with fresh sort keys, persisting in one flush.
Assigns sequential sort keys in default-sorted order and marks every set known and enabled, writing all records through the controller's batched saveSets() in a single settings flush instead of ~3 QSettings rewrite cycles per set, which froze the GUI thread for seconds on a first run with a full database.
| controller | The set priority controller to persist the records with. |
| void CardSetList::enableAllUnknownBatched | ( | ICardSetPriorityController * | controller | ) |
Enables all sets that are unknown or ignored, persisting in one flush.
Sets that are not marked as known and not ignored are marked as known and enabled. Ignored-known sets are also enabled, but remain ignored. Only changed sets are written, so the common case of a few new sets costs a single settings flush no matter how large the database is.
| controller | The set priority controller to persist the records with. |
| int CardSetList::getEnabledSetsNum | ( | ) |
Counts the number of sets that are currently enabled.
| QStringList CardSetList::getUnknownSetsNames | ( | ) |
Collects the short names of all sets marked as unknown.
| int CardSetList::getUnknownSetsNum | ( | ) |
Counts the number of sets that are currently unknown.
| void CardSetList::markAllAsKnownBatched | ( | ICardSetPriorityController * | controller | ) |
Marks all sets as known and adjusts their enabled state, persisting in one flush.
Unknown, non-ignored sets become known and disabled. Ignored-known sets are enabled if they were previously disabled. Only changed sets are written; when nothing is unknown no flush happens at all.
| controller | The set priority controller to persist the records with. |
| void CardSetList::sortByKey | ( | ) |
Sorts the set list by each set’s assigned sort key.
Uses KeyCompareFunctor internally. If two sets share the same sort key, their relative order is unspecified.