TheCOSCGameProject  1.0
dungeon.h
Go to the documentation of this file.
1 
8 #ifndef DUNGEON_H
9 #define DUNGEON_H
10 
11 #include <vector>
12 #include <random>
13 #include <map>
14 #include <queue>
15 #include "../lib/room.h"
16 
23 class Dungeon
24 {
25 public:
30  Dungeon();
31 
36  ~Dungeon();
37 
44 
50  int numRooms(Room *startRoom);
51 
58  void linkRooms(Room *room1, Room *room2, int direction); // Making it public for testing
59 
60  std::string getMap(Room *room);
61 
62 private:
63  std::vector<Room *> rooms;
64  std::mt19937 rng;
65 
70  Room *generateRoom(int x, int y);
71 
79  void checkAndLink(Room *newRoom, int x, int y, std::map<std::pair<int, int>, Room *> &roomMap);
80 };
81 
82 #endif // DUNGEON_H
Dungeon()
Constructor for the Dungeon class.
Definition: dungeon.cpp:16
std::string getMap(Room *room)
Get a string representation of the dungeon map centered on a specific room.
Definition: dungeon.cpp:110
Manages the generation and traversal of dungeon floors.
Definition: dungeon.h:23
~Dungeon()
Destructor for the Dungeon class.
Definition: dungeon.cpp:22
Room * generateFloor(int numRooms)
Generates a dungeon floor with a specified number of rooms.
Definition: dungeon.cpp:209
int numRooms(Room *startRoom)
Counts the number of rooms in the dungeon starting from a given room.
Definition: dungeon.cpp:274
void linkRooms(Room *room1, Room *room2, int direction)
Links two rooms together in a specified direction.
Definition: dungeon.cpp:50
Represents a room in the dungeon.
Definition: room.h:174