TheCOSCGameProject  1.0
room.h
Go to the documentation of this file.
1 
8 #ifndef ROOM_H
9 #define ROOM_H
10 
11 #include <vector>
12 #include <string>
13 #include <iostream>
14 #include "../lib/minigames.h"
15 #include "player.h"
16 
17 // Assuming these functions are declared in the toolkit.h
18 // std::vector<std::string> split(const std::string &str, char delimiter);
19 // int generateRandomNumber(int low, int high);
20 // int stringToInt(const std::string &str);
21 // std::string getFileContent(const std::string &filePath);
22 
29 {
30  std::string name;
31  int health;
32  int attack;
33 };
34 
40 struct NPC
41 {
42  std::string name;
43  std::unique_ptr<Game> gamblingGame;
44  int skillLevel;
45 };
46 
54 {
55 public:
60  RoomContent();
61 
65  void enemyRoom();
66 
70  void gamblingRoom();
71 
72  void lockedRoom();
73 
78  void addItem(const std::string &item);
79 
84  void addEnemy(const EnemyStruct &enemy);
85 
89  void displayContent() const;
90 
95  int getRoomType();
96 
101  std::string getRoomDesc();
102 
107  NPC &getNPC();
108 
113  std::vector<EnemyStruct> getEnemies();
114 
115  void clearEnemies();
116 
117  void clearText();
118 
124  void addCoordinates(int x, int y);
125 
130  std::pair<int, int> getCoordinates();
131 
136  bool getVisited();
137 
142  void setVisited(bool hasVisited);
143 
144  Game *getNonGamblingGame();
145 
146  std::vector<std::string> getItems();
147 
148  void displayRoomItems();
149 
150  bool collect(Player *player);
151 
152  int getCoins();
153 
154  bool emptyItems();
155 
156 private:
157  std::vector<std::string> items;
158  std::vector<EnemyStruct> enemies;
159  NPC npc;
160  bool passcode;
161  int roomType;
162  std::string roomDesc;
163  std::pair<int, int> cords;
164  bool visited;
165  std::unique_ptr<Game> nonGambilingGame;
166  int coins;
167 };
168 
174 class Room
175 {
176 public:
181  Room();
182 
188 
192  void displayAvailableDirections();
193 };
194 
195 #endif // ROOM_H
Manages the content within a room, including items, enemies, and NPCs.
Definition: room.h:53
Defines the Player class for the Valeris game.
int health
Health points of the enemy.
Definition: room.h:31
Room * south
Pointer to the room to the south.
Definition: room.h:184
Room * north
Pointer to the room to the north.
Definition: room.h:183
RoomContent roomContent
The content of the room.
Definition: room.h:187
Represents a non-player character (NPC) in a room.
Definition: room.h:40
Abstract base class for mini-games.
Definition: minigames.h:28
Room * east
Pointer to the room to the east.
Definition: room.h:186
std::string name
Name of the enemy.
Definition: room.h:30
Represents an enemy in a room.
Definition: room.h:28
int skillLevel
Skill level of the NPC in the gambling game.
Definition: room.h:44
std::string name
Name of the NPC.
Definition: room.h:42
int attack
Attack power of the enemy.
Definition: room.h:32
std::unique_ptr< Game > gamblingGame
Pointer to a gambling game associated with the NPC.
Definition: room.h:43
Room * west
Pointer to the room to the west.
Definition: room.h:185
Manages player attributes and actions.
Definition: player.h:20
Represents a room in the dungeon.
Definition: room.h:174