This repository has been archived by the owner on May 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CGame.h
118 lines (96 loc) · 3.15 KB
/
CGame.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//Header CGame.h
// @Author = Jan van Dick
#ifndef CGAME_H
#define CGAME_H
class CItem;
class CPerson;
class CEventManager;
class CInventory;
class CState;
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cstdio>
#include "CPlayer.h"
#include "CRoom.h"
#include "CDoor.h"
#include "CPerson.h"
#include "CInventory.h"
#include "CItem.h"
#include "CEventManager.h"
#include "CDialog.h"
#include "CQuest.h"
#include "CState.h"
#include "CList.h"
#include "CFunctions.h"
class CGame
{
private:
CPlayer* m_Player; //Player
CList<CRoom>* m_listAllRooms; //List containing all rooms in the game
CList<CDoor>* m_listAllDoors; //List containing all doors in the game
CList<CPerson>* m_listAllPeople; //List containing all people in the game
CList<CItem>* m_listAllItems; //List containing all items in the game
CEventManager* m_EM; //Eventmanager for Event: Item
public:
CGame() {
m_listAllRooms = new CList<CRoom>;
m_listAllDoors = new CList<CDoor>;
m_listAllPeople = new CList<CPerson>;
m_listAllItems = new CList<CItem>;
}
void gameCreate(char chPlayerName[128]); //create all rooms and door (return first room)
void play(); //Matrix for game
void worldFactory();
CRoom* roomFactory (char* chName, int num);
void doorFactory (char* chName, CRoom* myRoom, CRoom* linkedRoom, int localNum, int globalNum,
vector<string> sDescriptions, void(CDoor::*callDescription)());
void personFactory (char* chName, int num, CRoom* myRoom, void(CDialog::*func_dialog)(),
void(CQuest::*func_quest)());
void itemFactory (char* chName, int price, int quantity, void(CItem::*func_useItem)(), int num);
void playerFactory (char* chName, CRoom* startRoom, CInventory* playersInventory);
char* playerInput();
//Getter
//getPlayer: get current player
CPlayer* getPlayer() {
return m_Player;
}
//getRoomList: return list of all rooms in the game
CList<CRoom>* getRoomList() {
return m_listAllRooms;
}
//getDoorList: return list of all doors in the game
CList<CDoor>* getDoorList() {
return m_listAllDoors;
}
//getPeopleList: return list of all doors in the game
CList<CPerson>* getPeopleList() {
return m_listAllPeople;
}
//getItemList: return list of all items in the game
CList<CItem>* getItemList() {
return m_listAllItems;
}
//getRoom: return a room
CRoom* getRoom(char* chRoomName) {
return m_listAllRooms->getElement(chRoomName);
}
//getDoor: return a door
CDoor* getDoor(char* chDoorName) {
return m_listAllDoors->getElement(chDoorName);
}
//getPerson: return a person
CPerson* getPerson(char* chPersonName) {
return m_listAllPeople->getElement(chPersonName);
}
//getItem: return a item
CItem* getItem(char* chItemName) {
return m_listAllItems->getElement(chItemName);
}
//getEventManager: return the event manager
CEventManager* getEventManager() {
return m_EM;
}
};
#endif