[11393] | 1 | #include <vector> |
---|
| 2 | #include <string> |
---|
[11401] | 3 | #include "core/CoreIncludes.h" |
---|
| 4 | #include "core/GUIManager.h" |
---|
[11393] | 5 | |
---|
[11401] | 6 | |
---|
[11393] | 7 | #include "NextQuestion.h" |
---|
| 8 | #include "core/XMLPort.h" |
---|
| 9 | |
---|
| 10 | namespace orxonox{ |
---|
| 11 | |
---|
| 12 | RegisterClass(NextQuestion); |
---|
| 13 | |
---|
[11401] | 14 | NextQuestion::NextQuestion(Context* context) : BaseObject(context) |
---|
| 15 | { |
---|
| 16 | RegisterObject(NextQuestion); |
---|
| 17 | orxout() << "Klasse aufgerufen" << endl; |
---|
[11393] | 18 | |
---|
[11401] | 19 | } |
---|
| 20 | |
---|
| 21 | void NextQuestion::setquestion(std::string question){ |
---|
| 22 | question=question; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | std::string NextQuestion::getquestion(void){ |
---|
| 26 | return question; |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | // |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | //XML and Event shit |
---|
| 34 | void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode) |
---|
| 35 | { |
---|
| 36 | SUPER(NextQuestion, XMLPort, xmlelement, mode); |
---|
| 37 | |
---|
| 38 | XMLPortParam(NextQuestion, "question", setquestion, getquestion, xmlelement, mode); |
---|
| 39 | } |
---|
| 40 | bool NextQuestion::execute(bool bTriggered, BaseObject* trigger) |
---|
| 41 | { |
---|
| 42 | //if(!bTriggered) return false; |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | orxout() << "bTriggered is " << bTriggered << endl; |
---|
| 48 | |
---|
| 49 | for (DialogueManager* hud : ObjectList<DialogueManager>()) |
---|
| 50 | m = hud; |
---|
| 51 | m->setquestion(question); |
---|
| 52 | //orxout() << " 1 " << mystring << endl; |
---|
| 53 | return false; |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | void NextQuestion::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) |
---|
| 57 | { |
---|
| 58 | SUPER(NextQuestion, XMLEventPort, xmlelement, mode); |
---|
| 59 | |
---|
| 60 | XMLPortEventSink(NextQuestion, BaseObject, "execute", execute, xmlelement, mode); |
---|
| 61 | } |
---|
| 62 | /*void NextQuestion::setanswers(std::string option1, std::string option2, std::string option3){ |
---|
[11393] | 63 | options.at(0)=option1; |
---|
| 64 | options.at(1)=option2; |
---|
| 65 | options.at(2)=option3; |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | vector<std::string> NextQuestion::getanswers(void){ |
---|
| 69 | return options; |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | int NextQuestion::getnumOptions(){ |
---|
| 73 | return options.size(); |
---|
[11401] | 74 | }*/ |
---|
[11393] | 75 | |
---|
| 76 | } |
---|