data driving walls
This commit is contained in:
+14
-5
@@ -8,13 +8,22 @@
|
||||
#include <array>
|
||||
|
||||
struct Level {
|
||||
char data[MAX_ROWS][MAX_COLS];
|
||||
std::array<std::array<char, MAX_COLS>, MAX_ROWS> data;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
extern Level levels[];
|
||||
extern const char map[MAX_ROWS][MAX_COLS];
|
||||
class Manager {
|
||||
public:
|
||||
void clear_map();
|
||||
void load_map(const std::array<std::array<char, MAX_COLS>, MAX_ROWS> map_data);
|
||||
int get_current_level();
|
||||
void set_current_level(int level);
|
||||
std::array<std::array<Wall*, MAX_COLS>, MAX_ROWS> wall_list = {};
|
||||
private:
|
||||
int current_level = 1;
|
||||
|
||||
};
|
||||
|
||||
extern std::vector<Level> levels;
|
||||
|
||||
void clear_map(std::array<std::array<Entity*, MAX_COLS>, MAX_ROWS>& wall_list);
|
||||
void load_map(std::array<std::array<Entity*, MAX_COLS>, MAX_ROWS>& wall_list, const char map_data[MAX_ROWS][MAX_COLS]);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user