-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
49 lines (41 loc) · 1.02 KB
/
Player.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
43
44
45
46
47
48
#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <boost/serialization/serialization.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
// Îïðåäåëåíèå ïåðå÷èñëåíèÿ äëÿ ïîëà
enum Gender {
Male = 'Ì',
Female = 'Æ'
};
class Player {
private:
//int id;
std::string name;
int age;
int rating;
char gender;
std::string registrationDate;
bool isActive;
//double rankingPosition;
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive& ar, const unsigned int version) {
ar& name;
ar& age;
ar& rating;
ar& gender;
ar& registrationDate;
ar& isActive;
}
public:
Player();
virtual ~Player();
virtual void readFromConsole();
virtual void displayToConsole() const;
virtual void readFromFile(std::ifstream& inputFile);
virtual void writeToFile(std::ofstream& outputFile) const;
int getAge() const { return age; }
};