-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.hpp
39 lines (30 loc) · 839 Bytes
/
player.hpp
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
/*********************************************************************
** Program name: player.hpp
** Author: Jesse McKenna
** Date: 12/5/2017
** Description: Holds information unique to the player, including inventory
** of items and player's current state (win, lose, or playing)
*********************************************************************/
#ifndef PLAYER_HPP
#define PLAYER_HPP
#include <vector>
class Player
{
public:
enum State { NONE, PLAYING, WIN, LOSE };
private:
State state; // player's current state (playing, win, or lose)
const int INVENTORY_MAX = 2;
std::vector<char> inv;
public:
Player();
~Player();
void setState(State newState);
State getState();
void addItem(char item);
bool hasItem(char item);
bool useItem(char item);
void printInventory();
bool inventoryFull();
};
#endif