-
Notifications
You must be signed in to change notification settings - Fork 0
/
Level.h
71 lines (45 loc) · 1.67 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#include "CONFIGURATION.h"
#include "ECS/ECS_Coordinator.h"
class Place;
class Room;
class Level
{
friend class GAME;
private:
inline static int levelCount = -1;
LvType levelType;
int depth;
int levelID;
std::string mapFileName;
std::vector <SharedPtr<Room>> rooms;
std::vector <SharedPtr<Room>>* prevRooms;
std::vector<Entity> charactersOnLevel;
SharedPtr<Place> prevStairsDown;
SharedPtr<Place> stairsUp;
SharedPtr<Place> stairsDown;
Vector2D<SharedPtr<Place>> field; //vector equivalent of Place field[MYHEIGHT][MYLENGTH];
std::vector<Entity> entitiesToUpdate;
void init_field();
void make_level();
public:
Level(LvType p_levelType, int depthLevel, SharedPtr<Place> stairsDown, std::string fileName = "",
std::vector<SharedPtr<Room>>* previousRooms = nullptr);
~Level();
bool is_place_for_stairsUp();
//void change_levelType(LvType levelType);
void place_stairsDown_random();
void RESET_field();
// getters:
inline static int get_LevelCount() { return levelCount; };
inline Vector2D<SharedPtr<Place>>& get_fieldRef() { return field; }
inline std::vector<Entity>& get_charactersOnLevelRef() { return charactersOnLevel; }
inline std::vector<SharedPtr<Room>>& get_roomsRef() { return rooms; }
inline int getDepth() const { return depth; };
inline SharedPtr<Place> get_stairsDown() const { return stairsDown; };
inline SharedPtr<Place> get_stairsUp() const { return stairsUp; };
// setters
inline void set_stairsDown(SharedPtr<Place> set) { stairsDown = set; };
inline void set_stairsUp(SharedPtr<Place> set) { stairsUp = set; };
inline void set_rooms(std::vector<SharedPtr<Room>> roomsVec) { rooms = roomsVec; }
};