123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- #ifndef __VAULTS_H
- #define __VAULTS_H
- #include <set>
- #include <map>
- #include <string>
- #include <memory>
- struct Vault {
- tag_t tag;
- unsigned int level;
- unsigned int count;
- struct brush {
- bool is_blank;
- bool is_walk;
- bool is_water;
- tag_t terrain;
- struct design_t {
- enum class type_t : unsigned int {
- NONE,
- SPECIFIC,
- LEVEL,
- LEVEL_ANY
- };
- type_t type;
- tag_t tag;
- unsigned int level;
- design_t() : type(type_t::NONE), level(0) {}
- };
- design_t design;
- struct species_t {
- enum class type_t : unsigned int {
- NONE,
- SPECIFIC,
- GENUS,
- LEVEL
- };
-
- type_t type;
- tag_t tag;
- unsigned int level;
- species_t() : type(type_t::NONE), level(0) {}
- };
- species_t species;
- brush() : is_blank(false), is_walk(false), is_water(false) {}
- };
- typedef std::map<unsigned char, brush> brushes_t;
- brushes_t brushes;
- std::vector<std::string> pic;
- unsigned int ax;
- unsigned int ay;
- enum class placement_t : unsigned int {
- floor,
- water,
- corner,
- shoreline,
- lowlands,
- packing
- };
- placement_t placement;
- unsigned int w;
- unsigned int h;
- tag_t inherit;
- bool transpose;
- unsigned int priority;
- int px;
- int py;
- bool use_species_counts;
- enum class type_t : unsigned int {
- FIXED,
- SEMIRANDOM,
- RANDOM
- };
- type_t type;
- struct cloud_t {
- size_t n;
- mean_deviation_t distrib;
- std::vector<double> chances;
- std::vector<unsigned char> brushes;
- cloud_t() : n(0) {}
- };
- cloud_t cloud;
- struct blob_t {
- size_t n;
- placement_t placement;
- unsigned char brush;
- blob_t() : n(0), placement(placement_t::floor), brush(0) {}
- };
- blob_t blob;
- struct river_t {
- size_t n;
- unsigned char brush;
- mean_deviation_t angle;
- mean_deviation_t width;
- unsigned int splitchance;
- river_t() : n(0), brush(0), splitchance(0) {}
- };
- river_t river;
- struct room_t {
- unsigned int w1;
- unsigned int w2;
- unsigned int h1;
- unsigned int h2;
- unsigned char brush;
- room_t() : w1(0), w2(0), h1(0), h2(0), brush(0) {}
- };
- room_t room;
- struct tunnel_t {
- bool enabled;
- unsigned char plain_brush;
- unsigned char a_brush;
- unsigned char b_brush;
- tunnel_t() : enabled(false), plain_brush(0), a_brush(0), b_brush(0) {}
- };
- tunnel_t tunnel;
-
- Vault() : level(0), count(0), ax(0), ay(0), placement(placement_t::floor),
- w(0), h(0), transpose(false), priority(0), px(-1), py(-1),
- use_species_counts(false), type(type_t::FIXED) {}
- void postprocess() {
- unsigned int _h = pic.size();
- unsigned int _w = 0;
- for (const std::string& s : pic) {
- _w = std::max((unsigned int)s.size(), _w);
- }
- w = std::max(w, _w);
- h = std::max(h, _h);
- }
- };
- #endif
|