forked from HU-CS-224-master/hw02-fall-18
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
executable file
·131 lines (106 loc) · 2.46 KB
/
main.cpp
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#include <cstdlib>
#include <ctime>
#include <iostream>
//Structure to keep track of various locations
struct Point
{
int x;
int y;
Point(int _x, int _y): x(_x), y(_y)
{
}
};
//Structure for the Player object
struct Player
{
int food;
int health;
bool alive;
int x;
int y;
Player() : food(64), health(10), alive(true)
{}
void loseHealth()
{
if(health>0)
health--;
if(health==0)
alive = false;
}
void gainHealth()
{
if(health<10)
health++;
}
};
typedef const int cint; //Google typedef to see what this means
typedef const Point cPoint;
char* create_dungeon(int, int, Point&, Point&); //Creates the dungeon
void traversal(char*, Point&, cPoint&, cint, cint); //Used for moving inside dungeon
void combat(Player&, int); //Used for simulating combat
void trap_statements(); //3 statements that show at random when the player activates a trap
void food_statements(); //3 statements that show at random when the player finds food
void hit_statements(); //3 statements that show at random when the player hits enemy
void get_hit_statements();//3 statements that show at random when the player gets hit
int main ()
{
srand(time(0));
int width = 0;
int height = 0;
/*
* ADD YOUR CODE HERE IF REQUIRED
*/
Point start_point(0,0);
Point exit_point(0,0);
char* dungeon = nullptr;
dungeon = create_dungeon(dungeon, width, height, start_point, exit_point);
traversal(dungeon, startPoint, exit_point, width, height);
/*
* ADD YOUR CODE HERE IF REQUIRED
*/
return 0;
}
void trap_statements()
{
/*
* ADD YOUR CODE HERE AS REQUIRED
*/
}
void food_statements()
{
/*
* ADD YOUR CODE HERE AS REQUIRED
*/
}
void hit_statements()
{
/*
* ADD YOUR CODE HERE AS REQUIRED
*/
}
void get_hit_statements()
{
/*
* ADD YOUR CODE HERE AS REQUIRED
*/
}
void traversal(char* dungeon, Point& start_point, cPoint& exit_point,
cint width, cint height)
{
/*
* ADD YOUR CODE HERE AS REQUIRED. DEFINE NEW FUNCTIONS IF IT GETS LONG.
*/
}
void combat(Player& player, int enemies)
{
/*
* ADD YOUR CODE HERE AS REQUIRED
*/
}
char* create_dungeon(int width, int height,
Point& ref_startPoint, Point& ref_exitPoint)
{
/*
* ADD YOUR CODE HERE AS REQUIRED. DEFINE NEW FUNCTIONS IF IT GETS LONG.
*/
}