mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-28 11:50:25 -07:00
* [Game] Use in-game menu for tally setting * pluralize name * fix includes * clean up TallyMenu * update settings * fix guard
23 lines
546 B
C++
23 lines
546 B
C++
#include "tally.h"
|
|
|
|
#include "subtype_tally.h"
|
|
|
|
TallyType Tally::intToType(int value)
|
|
{
|
|
if (value < static_cast<int>(TallyType::None) || value > static_cast<int>(TallyType::MaxValue)) {
|
|
return TallyType::None;
|
|
}
|
|
|
|
return static_cast<TallyType>(value);
|
|
}
|
|
|
|
QList<TallyRow> Tally::compute(const QList<CardItem *> &cards, const TallyType type)
|
|
{
|
|
switch (type) {
|
|
case TallyType::None:
|
|
return {};
|
|
case TallyType::Subtypes:
|
|
return SubtypeTally::countSubtypes(cards);
|
|
}
|
|
return {};
|
|
}
|