-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHuman.h
64 lines (56 loc) · 1.12 KB
/
Human.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// Human.hpp
// assn2
//
// Created by Thomas on 2018-10-16.
// Copyright © 2018 Thomas. All rights reserved.
//
#ifndef Human_h
#define Human_h
#include <stdio.h>
#include "Player.h"
#include "Guess.h"
#include <string>
using namespace std;
class Human : public Player
{
private:
string name;
public:
// constructor created with name initialize player score to 3
Human(string nm):Player(3)
{
name = nm;
}
// access name
const string &getName() const
{
return name;
cout << endl;
}
// access guess for player allow them to input a guess
Guess getGuess() const
{
char x;
cout << "Enter a guess R, P or S: ";
cin >> x;
Guess a;
switch(x)
{
case 'R':
a = Guess('R');
break;
case 'P':
a = Guess('P');
break;
case 'S':
a = Guess('S');
break;
default:
break;
}
return a;
cout << endl;
}
};
#endif /* Human_hpp */