-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.h
40 lines (33 loc) · 1.16 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
/*
Parke Lovett
player.h file - class declaration - Topic 2
*/
#ifndef PLAYER_H
#define PLAYER_H
#include <iostream>
#include <fstream>
#include <string>
class Player{
public:
Player();
void setName(const std::string& nameToSet);
void setScore(int scoreToSet);
std::string toString() const;
std::string toFileString() const;
std::string getName() const;
int getScore() const;
friend bool operator==(const Player& lhs, const Player& rhs);
friend bool operator !=(const Player& lhs, const Player& rhs);
friend bool operator >(const Player& lhs, const Player& rhs);
friend bool operator <=(const Player& lhs, const Player& rhs);
friend bool operator >=(const Player& lhs, const Player& rhs);
friend bool operator <(const Player& lhs, const Player& rhs);
friend std::istream& operator >>(std::istream& input, Player& rhs);
friend std::ifstream& operator >>(std::ifstream& input_file, Player& rhs);
friend std::ostream& operator <<(std::ostream& output, const Player& rhs);
friend std::ofstream& operator <<(std::ofstream& output_file, const Player& rhs);
private:
std::string name;
int score;
};
#endif