-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlevel.h
49 lines (36 loc) · 1.02 KB
/
level.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
#ifndef LEVEL_H_
#define LEVEL_H_
#include <vector>
#include <array>
#include <algorithm>
#include "entity.h"
#include "enemy.h"
#include "environment.h"
#include "constants.h"
#include "rng.h"
// a level containing a map, and entities
class Level {
public:
Level();
~Level();
Level NextFloor();
static void TryMoveEntity(Level*, Level*, Entity*);
std::vector<Entity*> entities_;
int GetUpStairY();
int GetUpStairX();
int GetDownStairY();
int GetDownStairX();
std::array<std::array<Tile, kMapWidth>, kMapHeight> map_;
std::array<std::array<bool, kMapWidth>, kMapHeight> GetTransparent();
std::vector<Room> GetRooms();
void FreeEntities();
private:
std::vector<Room> rooms_;
int up_stair_y, up_stair_x, down_stair_y, down_stair_x;
// methods to generate the level
void GenerateRooms();
void GenerateTunnels();
void ApplyRooms();
void PopulateRooms();
};
#endif