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