Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Dialog_HS17/src/modules/dialog/Dialog.h @ 11611

Last change on this file since 11611 was 11611, checked in by kuchlert, 6 years ago

fixed addQuestion and addAnswer in Dialog

File size: 1.5 KB
Line 
1#ifndef _Dialog_H__
2#define _Dialog_H__
3
4#include "core/BaseObject.h"
5#include "DialogPrereqs.h"
6#include "Question.h"
7#include "Answer.h"
8#include "core/XMLPort.h"
9#include "core/CoreIncludes.h"
10#include "overlays/OrxonoxOverlay.h"
11
12#include <map>
13#include <vector>
14#include <string>
15
16namespace orxonox
17{
18        class _DialogExport Dialog : public BaseObject
19        {
20                public:
21                        Dialog(Context* context);
22
23                        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
24                        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
25
26                        void setName(std::string name);
27                        std::string getName();
28
29                        void setCurrentQuestionId(std::string questionId);
30                        std::string getCurrentQuestionId();
31
32                        void addQuestion(Question* question); //fuegt Question der Map hinzu
33                        void addAnswer(Answer* answer); //fuegt Answer der Map hinzu
34
35                        Question* getQuestion(unsigned int index) const; // returned string der momentanen Frage
36                        Answer* getAnswer(unsigned int index) const; // returned string der momentanen Frage
37                        std::vector<std::string> getAnswers();  // returned vector mit allen momentanen AntwortenIds
38
39                        bool execute(bool bTriggered, BaseObject* trigger);
40
41                        void update(std::string givenAnswer);
42
43                        bool ending(); //retruned true wenn die Id der Antwort end ist oder keine Antworten auf die frage eingetragen sind
44
45
46                private: 
47                        std::string name_;
48                        std::string currentQuestionId_;
49                        std::map<std::string, Question*> questions_;
50                        std::map<std::string, Answer*> answers_;
51        };
52}
53
54#endif
Note: See TracBrowser for help on using the repository browser.