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
/
Quests.cpp
60 lines (44 loc) · 1.53 KB
/
Quests.cpp
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
//Quests.cpp
#include <iostream>
#include "CQuest.h"
//Constructor
CQuest::CQuest(CGame* game, void (CQuest::*func)())
{
//Assign attributes
m_questStatus = false;
//Assign game instance and function-pointer
m_game = game; //Game instance
m_func = func; //Pointer to function setting up quest
//Create empty List for steps
m_questSteps = new CList<CQuestStep>; //New list of quest steps
buildQuest(); //Build quest
}
//buildQuest: builds the quests, i.a. sets up the steps etc.
void CQuest::buildQuest() {
(this->*m_func)();
}
//StartQuest: sets quest on active
void CQuest::startQuest() {
cout << "Quest \"" << m_chName << "\" started and is now active." << endl;
m_questSteps->iterateElements(m_questSteps->getNumElements())->startQueststep();
}
//Quests
void CQuest::quest_Standard()
{
CFunctions F; //Provides various functions
F.allocate(m_chName, (char*)"Standard");
m_questNum = 0;
}
//KARL MARX
void CQuest::quest_Marx()
{
CFunctions F; //provides various functions
F.allocate(m_chName, (char*)"Talk to the dog");
m_questNum = 11;
CQuestStep* step1 = new CQuestStep((char*)"Talk to Dog", 1, m_game, &CQuestStep::questMarx_Step1);
m_questSteps->add(step1);
CQuestStep* step2 = new CQuestStep((char*)"Talk to Marx", 2, m_game, &CQuestStep::questMarx_Step2);
m_questSteps->add(step2);
CQuestStep* step3 = new CQuestStep((char*)"Jump around", 3, m_game, &CQuestStep::questMarx_Step2);
m_questSteps->add(step3);
}