This repository has been archived by the owner on Jun 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.h
64 lines (61 loc) · 1.83 KB
/
map.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
#ifndef map_h
#define map_h
#include<vector>
#include<string>
#include"gameobject.h"
#include"tile.h"
class tilearray{
protected:
tile** tiles;
ushort width, height, depth;
unsigned int size;
tile* GetTileDangerous(ushort x, ushort y, ushort z);
public:
tilearray(ushort width, ushort height, ushort depth);
virtual ~tilearray();
void SetTile(ushort x, ushort y, ushort z, tile* target);
tile* GetTile(ushort x, ushort y, ushort z);
tile* GetTileDangerous(unsigned int i);
void DelTile(tile *target, tilewspace* replacement);
void DelTile(ushort x, ushort y, ushort z, tilewspace* replacement);
ushort GetWidth();
ushort GetHeight();
ushort GetDepth();
};
class map:public tilearray{
protected:
bool* revealed;
bool* visible;
tile* air;
tile* borderstone;
tile* CastRay(tile* start, tile* end);
public:
map(ushort width, ushort height, ushort depth);
virtual ~map();
bool GetRevealed(tile* place);
bool GetVisible(tile* place);
void SetRevealed(tile* place, bool key);
void SetVisible(tile* place, bool key);
void SetRevealed(tilearray* sphere, bool key);
void SetVisible(tilearray* sphere, bool key);
void DelTile(tile* target);
void DelTile(ushort x, ushort y, ushort z);
tile* FindTileOnVertical(ushort x, ushort y);
tilearray* GetSphere(tile* center, ushort radius);
};
class Perlin: public map{
std::vector<tile*> coverstone;
std::vector<tile*> surfstone;
std::vector<tile*> midstone;
std::vector<tile*> deepstone;
tile* FindTile(std::string name, std::vector<tile*> tiletypes);
tile* PickRand(std::vector<tile*> tiletypes);
tile* PickCover(std::vector<tile*> tiletypes);
tile* PickSurface(std::vector<tile*> tiletypes);
tile* PickMiddle(std::vector<tile*> tiletypes);
tile* PickDeep(std::vector<tile*> tiletypes);
public:
Perlin(ushort width, ushort height, ushort depth, std::vector<tile*> tiletypes);
~Perlin();
};
#endif