- Timestamp:
- Feb 15, 2018, 11:18:38 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Presentation_HS17_merge/src/modules/dialog/Dialog.cc
r11749 r11750 89 89 } 90 90 91 const Question* Dialog::getQuestion() const // returned nichts91 Question* Dialog::getQuestion(unsigned int index) const 92 92 { 93 return nullptr; 93 unsigned int i = 0; 94 for (auto entry : this->questions_) 95 { 96 if (i == index) 97 return entry.second; 98 ++i; 99 } 100 return nullptr; 94 101 } 95 102 … … 99 106 } 100 107 101 const Answer* Dialog::getAnswer(unsigned int index) const //returned sting der Antwort zur Id.108 Answer* Dialog::getAnswer(unsigned int index) const 102 109 { 103 return nullptr; 110 unsigned int i = 0; 111 for (auto entry : this->answers_) 112 { 113 if (i == index) 114 return entry.second; 115 ++i; 116 } 117 return nullptr; 104 118 } 105 119 106 120 107 const std::vector<std::string> * Dialog::getAnswerIds()// returned vector mit allen momentanen AntwortenIds121 const std::vector<std::string>& Dialog::getAnswerIds() const // returned vector mit allen momentanen AntwortenIds 108 122 { 109 123 110 124 Question* question = (this->questions_.find(this->currentQuestionId_))->second; 111 const std::vector<std::string>* answers = question->getAnswerIds(); 112 return answers; 125 return question->getAnswerIds(); 113 126 114 127 } … … 145 158 } 146 159 147 const std::string& Dialog::getAnswerString( std::stringanswerId)160 const std::string& Dialog::getAnswerString(const std::string& answerId) 148 161 { 149 162 return this->answers_.find(answerId)->second->getAnswer();
Note: See TracChangeset
for help on using the changeset viewer.