-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.h
73 lines (52 loc) · 1.55 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*This will be the Player class*/
//preprocessor
#ifndef PLAYER_H
#define PLAYER_H
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#include "item.h"
class Player {
//member data
string name;
vector<Item> inventory;
int xcoord, ycoord;
public:
//constructors
Player();
Player(string name0);
~Player() {}
//member functions
//returns the player name
string get_name();
//returns the player xcoord
int get_xcoord();
//returns the player ycoord
int get_ycoord();
//returns a pointer to the player's inventory vector
vector<Item>* get_inventory();
//returns the amount of items in the player's inventory
int get_inventory_size();
//list the player's inventory
void list_inventory();
//set the player name
void set_name(string name0);
//set the player position
void set_pos(int xcoord0, int ycoord0);
//add an Item to player inventory
void add_item(Item item0);
//remove an Item from player inventory
void remove_item(Item item0);
//resets the player data to default constructor data
void reset();
//moves the player north
bool move_north(vector<int>* flags);
//moves the player south
bool move_south(vector<int>* flags);
//moves the player east
bool move_east(vector<int>* flags);
//moves the player west
bool move_west(vector<int>* flags);
};
#endif