TODO: modify other races constructors
did some reworking
This commit is contained in:
42
src/level.h
42
src/level.h
@ -2,30 +2,56 @@
|
||||
#define __LEVEL_H__
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "display.h"
|
||||
#include "characters.h"
|
||||
#include "potion.h"
|
||||
#include "enemies.h"
|
||||
#include "potions.h"
|
||||
#include "constants.h"
|
||||
#include "gold.h"
|
||||
#include "map.h"
|
||||
|
||||
class level {
|
||||
private:
|
||||
static const int MAX_POTION_CNT = 15;
|
||||
static const int MAX_ENEMIE_CNT = 30;
|
||||
static const int MIN_POTION_CNT = 10;
|
||||
static const int MIN_ENEMIE_CNT = 20;
|
||||
static const int GOLD_CNT = 10;
|
||||
|
||||
const feature enabled_features;
|
||||
game_map map;
|
||||
const character &player;
|
||||
character *player;
|
||||
std::vector<std::unique_ptr<character>>pchlist;
|
||||
std::vector<std::unique_ptr<potion>>pplist;
|
||||
character_list chlist;
|
||||
potion_list plist;
|
||||
gold_list glist;
|
||||
public:
|
||||
// randomly generate a map
|
||||
level(const character &player);
|
||||
level(character *player, RNG *rng, const feature enabled_features);
|
||||
// read map from a string
|
||||
level(const std::string &map_data, const character &player);
|
||||
void print(display &out) const;
|
||||
void run();
|
||||
position_list get_available_positions() const;
|
||||
level(const std::string &map_data, character *player, RNG *rng,
|
||||
const feature enabled_features);
|
||||
void print(display *out) const;
|
||||
|
||||
bool is_available(const position &pos) const;
|
||||
position_list get_available_around(const position &pos) const;
|
||||
position get_up_stairs() const;
|
||||
position get_down_stairs() const;
|
||||
|
||||
// you can delete the pointers to the stuff
|
||||
character_list &get_chlist();
|
||||
potion_list &get_plist();
|
||||
gold_list &get_glist();
|
||||
private:
|
||||
// every gen will delete the positions in tiles
|
||||
void gen_potions(RNG *rng, std::vector<position_list> &tiles);
|
||||
void gen_gold(RNG *rng, std::vector<position_list> &tiles);
|
||||
void gen_enemies(RNG *rng, std::vector<position_list> &tiles);
|
||||
|
||||
position get_rand_pos(RNG *rng, std::vector<position_list> &tiles);
|
||||
gold_list dragon_hoard();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user