forked from Kamal-Sadek/Liberal-Crime-Squad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsitemap.h
116 lines (103 loc) · 3.08 KB
/
sitemap.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
#ifndef SITEMAP_H_INCLUDED
#define SITEMAP_H_INCLUDED
#include "includes.h"
#define SITEMAP_ADDTYPE_OR 1
#define SITEMAP_ADDTYPE_ANDNOT 2
enum sitemapscripts
{
SITEMAPSCRIPT_ROOM,
SITEMAPSCRIPT_HALLWAY_YAXIS,
SITEMAPSCRIPT_STAIRS,
SITEMAPSCRIPT_STAIRS_RANDOM
};
void build_site(std::string name);
// configSiteCommand is anything the configSiteMap stores in its array of stuff to build
class configSiteCommand : public configurable
{
public:
void virtual build() = 0;
virtual ~configSiteCommand() { }
private:
};
// configSiteMap derives from configurable, is a sitemap
class configSiteMap : public configurable
{
public:
virtual ~configSiteMap();
void configure(const std::string& command, const std::string& value);
void build();
bool operator==(const std::string& rhs) { return name == rhs; }
private:
std::string name;
std::string parent;
std::vector<configSiteCommand *> commands;
configSiteCommand* current_command;
};
// Paints tiles during map creation
class configSiteTile : public configSiteCommand
{
public:
configSiteTile(const std::string& value);
void configure(const std::string& command, const std::string& value);
void build();
private:
char xstart, xend, ystart, yend, zstart, zend;
int tile;
char addtype;
};
// Executes a complex set of code during map creation
class configSiteScript : public configSiteCommand
{
public:
configSiteScript(const std::string& value);
void configure(const std::string& command, const std::string& value);
void build();
private:
char xstart, xend, ystart, yend, zstart, zend;
char script;
/* recursive dungeon-generating algorithm */
void generateroom(int rx,int ry,int dx,int dy,int z);
/* generates a hallway with rooms on either side */
void generatehallway_y(int rx, int ry, int dx, int dy, int z);
/* generates a stairwell */
void generatestairs(int rx, int ry, int rz, int dx, int dy, int dz);
/* generates randomly placed stairs, one up and one down per z-level except
for top and bottom where there only be one down respectively one up. */
void generatestairsrandom(int rx, int ry, int rz, int dx, int dy, int dz);
};
// Drops specials down during map creation
class configSiteSpecial : public configSiteCommand
{
public:
configSiteSpecial(const std::string& value);
void configure(const std::string& command, const std::string& value);
void build();
private:
char xstart, xend, ystart, yend, zstart, zend;
char special;
int freq;
};
// Creates a unique during map creation
class configSiteUnique : public configSiteCommand
{
public:
configSiteUnique(const std::string& value);
void configure(const std::string& command, const std::string& value);
void build();
private:
char xstart, xend, ystart, yend, zstart, zend;
char unique;
};
// Adds a loot type during map creation
class configSiteLoot : public configSiteCommand
{
public:
configSiteLoot(const std::string& value);
void configure(const std::string& command, const std::string& value);
void build();
private:
//char loot;
std::string loot;
int weight;
};
#endif