-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoom.h
More file actions
35 lines (27 loc) · 884 Bytes
/
Room.h
File metadata and controls
35 lines (27 loc) · 884 Bytes
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
#ifndef ROOM_H
#define ROOM_H
#include <string>
#include <vector>
#include <utility> // for std::pair
#include <memory>
#include "Buff.h"
#include "Player.h"
#include "Encounter.h"
class Room {
public:
Room(const std::string& desc);
void setBuff(const Buff& buff);
bool hasBuff() const;
void giveBuff(Player& player); // if player comes into buff room then give buff
void addEdge(Room* room, int weight); // add edge to a node
std::vector<std::pair<Room*, int>> getEdges() const;
std::string getDesc() const; // room desc
void setEncounter(std::unique_ptr<Encounter> encounter);
void triggerEncounter(Player& player);
private:
std::string desc; // room description
Buff* roomBuff;
std::vector<std::pair<Room*, int>> edges; // connections to other rooms
std::unique_ptr<Encounter> encounter; // encounter in room
};
#endif