Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
CardSetList Class Reference

A list-like container for CardSet objects with extended management methods. More...

#include <card_set_list.h>

Inheritance diagram for CardSetList:
[legend]
Collaboration diagram for CardSetList:
[legend]

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 guessSortKeys ()
 Reassigns sort keys based on the current order.
void enableAllUnknown ()
 Enables all sets that are unknown or ignored.
void enableAll ()
 Enables all sets in the list.
void markAllAsKnown ()
 Marks all sets as known and adjusts their enabled state.
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.

Detailed Description

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.

Member Function Documentation

◆ defaultSort()

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.

Here is the caller graph for this function:

◆ enableAll()

void CardSetList::enableAll ( )

Enables all sets in the list.

Equivalent to calling setEnabled(true) on each entry.

◆ enableAllUnknown()

void CardSetList::enableAllUnknown ( )

Enables all sets that are unknown or ignored.

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.

◆ getEnabledSetsNum()

int CardSetList::getEnabledSetsNum ( )

Counts the number of sets that are currently enabled.

Returns
Integer count of enabled sets.

◆ getUnknownSetsNames()

QStringList CardSetList::getUnknownSetsNames ( )

Collects the short names of all sets marked as unknown.

Returns
A list of unknown set names.

◆ getUnknownSetsNum()

int CardSetList::getUnknownSetsNum ( )

Counts the number of sets that are currently unknown.

Returns
Integer count of unknown sets.

◆ guessSortKeys()

void CardSetList::guessSortKeys ( )

Reassigns sort keys based on the current order.

Calls defaultSort() and then assigns sequential sort keys to all sets according to their resulting positions, replacing any existing sort keys to ensure consistent ordering.

Here is the call graph for this function:

◆ markAllAsKnown()

void CardSetList::markAllAsKnown ( )

Marks all sets as known and adjusts their enabled state.

Unknown, non-ignored sets become known and disabled. Ignored-known sets are enabled if they were previously disabled.

◆ sortByKey()

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.


The documentation for this class was generated from the following files: