-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStatsCollection.h
42 lines (33 loc) · 939 Bytes
/
StatsCollection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// /////////////////////////////////////////////////////////
//
// File: clerdle/StatsCollection.h
// Author: Michael Foster
// Date: 2022.04.29
//
// This is the header file for StatsCollection.cpp.
// See that file for more information.
//
// /////////////////////////////////////////////////////////
#ifndef STATSCOLLECT_H
#define STATSCOLLECT_H
#include <vector>
#include <fstream>
#include "Player.h"
class Stats
{
private:
const std::vector<std::string> HEADER_MAP;
std::ofstream fileout_;
std::vector<Player *> players_;
Player *findPlayer(std::string, bool = true);
bool parseFile(std::ifstream &);
void storeFile();
public:
Stats();
~Stats();
void recordGame(std::string, int);
std::vector<int> getPlayerStats(std::string, bool = true);
std::vector<int> getPlayerStats(Player *);
std::map<std::string, std::vector<int>> getAllPlayerStats();
};
#endif