Cockatrice/cockatrice/src/game_graphics/tally/tally.cpp
RickyRister ca1c063687
[Game] Implement total power tally (#7057)
* [Game] Implement total power tally

* PR comments
2026-08-02 19:20:47 -07:00

26 lines
664 B
C++

#include "tally.h"
#include "stats_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);
case TallyType::TotalPower:
return StatsTally::computeTotalPower(cards);
}
return {};
}