Changeset 11607 for code/branches/Dialog_HS17/src/modules/dialog/Dialog.cc
- Timestamp:
- Nov 27, 2017, 4:57:47 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Dialog_HS17/src/modules/dialog/Dialog.cc
r11579 r11607 3 3 #include "core/XMLPort.h" 4 4 #include "core/EventIncludes.h" 5 #include "Dialog.h" 6 #include "Question.h" 5 7 6 8 namespace orxonox … … 21 23 XMLPortParam(Dialog, "name", setName, getName, xmlelement, mode); 22 24 XMLPortParam(Dialog, "currentQuestionId", setCurrentQuestionId, getCurrentQuestionId, xmlelement, mode); 23 XMLPortObject(Dialog, Question, "Questions", addQuestion, getQuestion, xmlelement, mode);25 XMLPortObject(Dialog, Question, "Questions", addQuestion, getQuestion, xmlelement, mode); 24 26 XMLPortObject(Dialog, Answer, "Answers", addAnswer, getAnswer, xmlelement, mode); 25 27 } … … 53 55 54 56 55 void Dialog::addQuestion(Question question) //fuegt Question der Map hinzu57 void Dialog::addQuestion(Question* question) //fuegt Question der Map hinzu 56 58 { 57 //questions_.emplace(question .getQuestionId, question);59 //questions_.emplace(question->getQuestionId(), question->getQuestion()); 58 60 } 59 61 60 void Dialog::addAnswer(Answer answer) //fuegt Answer der Map hinzu62 void Dialog::addAnswer(Answer* answer) //fuegt Answer der Map hinzu 61 63 { 62 //answers_.emplace(std::make_pair(answer .getAnswerId, answer));64 //answers_.emplace(std::make_pair(answer->getAnswerId(), answer->getAnswer())); 63 65 } 64 66 65 std::string Dialog::getQuestion()// returned nichts67 Question* Dialog::getQuestion(unsigned int index) const // returned nichts 66 68 { 67 Question question = (questions_.find(this->currentQuestionId_))->second; 68 return question.getQuestion(); 69 return nullptr; 70 // Question question = (questions_.find(this->currentQuestionId_))->second; 71 // return question.getQuestion(); 69 72 } 70 73 71 std::string Dialog::getAnswer(std::string answerId)//tolua_export //returned sting der Antwort zur Id.74 Answer* Dialog::getAnswer(unsigned int index) const//tolua_export //returned sting der Antwort zur Id. 72 75 { 73 return (this->answers_.find(answerId))->second.getAnswer(); 76 return nullptr; 77 // return (this->answers_.find(answerId))->second.getAnswer(); 74 78 } 75 79
Note: See TracChangeset
for help on using the changeset viewer.