This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
ESGRAF48/source/CheckableItem/CheckableItems.cpp

21 lines
398 B
C++

#include "CheckableItems.h"
#include <QJsonArray>
#include <numeric>
CheckableItems::CheckableItems(std::initializer_list<std::string> itemNames)
{
for (const auto &itemName : itemNames)
{
emplace_back(itemName);
}
}
unsigned int CheckableItems::getPoints() const
{
return std::accumulate(begin(), end(), 0, [](int base, const CheckableItem &item) {
return base + item.points();
});
}