Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
tally.h
Go to the documentation of this file.
1#ifndef COCKATRICE_TALLY_H
2#define COCKATRICE_TALLY_H
3#include <QString>
4
5class CardItem;
6
8struct TallyRow
9{
10 QString name;
11 QString value;
12
13 bool operator==(const TallyRow &) const = default;
14};
15
19enum class TallyType
20{
24 MaxValue = TotalPower // sentinel value
25};
26
27namespace Tally
28{
29
36TallyType intToType(int value);
37
46QList<TallyRow> compute(const QList<CardItem *> &cards, TallyType type);
47
48} // namespace Tally
49
50#endif // COCKATRICE_TALLY_H
Definition card_item.h:27
Definition tally.h:28
TallyType intToType(int value)
Definition tally.cpp:6
QList< TallyRow > compute(const QList< CardItem * > &cards, TallyType type)
Analyzes the selected cards according to the tally type and builds the resulting tally rows....
Definition tally.cpp:15
A single row of the tally output.
Definition tally.h:9
QString value
Value for the row (displayed on the right).
Definition tally.h:11
QString name
The row name (displayed on the left).
Definition tally.h:10
bool operator==(const TallyRow &) const =default
TallyType
Definition tally.h:20
@ None
Definition tally.h:21
@ MaxValue
Definition tally.h:24
@ TotalPower
Definition tally.h:23
@ Subtypes
Definition tally.h:22