1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

statisic basic

This commit is contained in:
Laserlicht
2024-07-27 02:11:26 +02:00
parent b7b25bffd2
commit fb171ab3a2
9 changed files with 126 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
/*
* GameStatistics.cpp, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "GameStatistics.h"
VCMI_LIB_NAMESPACE_BEGIN
void StatisticDataSet::add(StatisticDataSetEntry entry)
{
data.push_back(entry);
}
std::string StatisticDataSet::toCsv()
{
std::stringstream ss;
ss << "Day" << ";" << "Player" << "\r\n";
for(auto & entry : data)
{
ss << entry.day << ";" << entry.player.getNum() << "\r\n";
}
return ss.str();
}
VCMI_LIB_NAMESPACE_END