-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworld.h
45 lines (36 loc) · 1.2 KB
/
world.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
#include "object.h"
// Stores information about a single Grovnik tile.
class grovnik {
public:
grovnik();
grovnik(const grovnik & copy); // Copy constructor
grovnik(int terr_type, object * data); // complex constructor
~grovnik();
void setData(int terr_type, object * data);
//private: 'proper' structure dictates use of private variables,
// but having a manager for the data makes that unwieldly and unnessecary.
int terrain; // type of terrain
object * poi; // Point of interest on this tile
};
class World {
public:
World();
World(unsigned int width1, unsigned int length1);
// The world should never by directly copied.
~World();
// grovnik builder for use by world builders
void setGrovnik(unsigned int y, unsigned int x, int terr_type, object * data);
void clearfog(unsigned int y1, unsigned int x1);
void clearfog_rad(unsigned int y1, unsigned int x1, unsigned int radius);
char ** fileRead(int * heroy, int * herox);
grovnik * getAt(unsigned int y, unsigned int x);
bool getfog(unsigned int y1, unsigned int x1);
bool clearPOI(int y, int x);
#ifdef TEST
bool ** getfog();
#endif
private:
unsigned int width, height;
grovnik ** tiles;
bool ** fog; // false is fog, true is clear
};