-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobject.h
146 lines (109 loc) · 2.63 KB
/
object.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
//Author of header: Leah Moser
//Program: Frupal Game
//Date: 11/10/20
//This is the header file for the heirarchical relationship portion
//of the program. This file holds all the prototypes for the funcitonality of the
//implementation file.
//Note to the group: Please feel free to change anything you see might need
//changing
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <stdio.h>
#include <stdlib.h>
#ifndef OBJECT_H
#define OBJECT_H
using namespace std;
class food;
class tool;
class clue;
class obstacle;
class object
{
public:
object(); //default constructor
object(const object & to_copy); //copy constructor
object(int add_type, int add_cost); //constructor with args
virtual ~object();//destructor
int get_type();
int get_cost();
//type 2
food * getFood();
//type 3
tool * getTool();
//type 4
clue * getClue();
//type 7
obstacle * getObst();
protected:
int type;
int cost; //How much this object costs
};
class food: public object
{
public:
food(); //default constructor
food(int add_cost, char *add_name, int value); //constuctor with args
food(const food &to_copy); //copy constructor
~food(); //destructor
char* get_name();
int get_value();
protected:
char *name; //The name of the food
int value; //How much energy is restored
};
class tool: public object
{
public:
tool(); //default constructor
//constructor with args
tool(int add_cost, char *add_name, int add_power, int obs_type);
tool(const tool &to_copy);
int get_obstype();
int get_power();
char* get_t_name();
~tool(); //destrucor
protected:
char *name; //The name of the tool
int power; //how much power it has?
int obs_type; // What type(s?) of obsticles this is useful for
};
class treasure: public object
{
public:
treasure(); //default constructor
//constructor with args
treasure(int add_cost, bool isempty);
treasure(const treasure &to_copy); //copy constructor
~treasure(); // destructor
bool get_empty();
protected:
bool is_empty; //will it dissapear when empty?
//Treasure chests appear to be defined to only contain whiffles.
//Cost is repurposed to how much money you gain when opened.
};
class obstacle: public object
{
public:
obstacle(); //default constructor
//constructor with args
obstacle(int add_cost, int obs_type);
obstacle(const obstacle &to_copy); //copy constructor
~obstacle(); // destructor
int get_obstacle();
protected:
//Cost is repurposed into Durability, or Cost to destroy
int obs_type; // The obsticle type
};
class clue: public object
{
public:
clue();
clue(char * data);
~clue();
char * getHint();
protected:
char * hint;
};
#endif