- Timestamp:
- May 26, 2017, 3:40:04 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
r11432 r11435 18 18 19 19 20 //DialogueManager* DialogueManager::singletonPtr_s =nullptr; 21 22 DialogueManager::DialogueManager(){ 23 orxout() << "Dialog Konstruktor" << endl; 24 //RegisterObject(DialogueManager); 25 26 } 20 21 DialogueManager::DialogueManager(){} 27 22 28 23 29 /** 30 * @brief set the config values in the orxonox.ini file 31 */ 24 32 25 33 26 … … 35 28 if(allQuestions.size()==0) { 36 29 orxout(internal_info) << "At least one NextQuestion has to be set." << endl; 37 } else { 38 currentQuestion = allQuestions[0]; 39 } 30 } 40 31 allQuestions.push_back(nq); 41 32 orxout(internal_info) << "qsize " << allQuestions.size(); … … 53 44 54 45 std::string DialogueManager::getquestion(void){ 55 orxout() << question << endl;56 46 return question; 57 47 } 48 58 49 void DialogueManager::setanswers1(std::string a1){ 59 orxout() << "setanswers1" << endl;60 50 this->a1=a1; 61 orxout() << "A1 is " << a1;62 51 } 63 52 … … 69 58 70 59 std::string DialogueManager::getanswers1(void){ 71 orxout() << "getanswers1" << endl;72 60 return a1; 73 61 } … … 76 64 return a2; 77 65 } 66 78 67 void DialogueManager::a1clicked(void){ 79 80 68 81 69 currentQuestion = currentQuestion->possibleQuestions[0]; … … 85 73 } 86 74 void DialogueManager::a2clicked(void){ 87 orxout() << "a2 clicked" << endl; 88 75 89 76 currentQuestion = currentQuestion->possibleQuestions[1]; 90 77 update(currentQuestion); 78 } 91 79 92 93 }94 80 void DialogueManager::update(NextQuestion* nq){ 95 81 this->setquestion(nq->getquestion()); 96 82 this->setanswers1(nq->getanswers1()); 97 83 this->setanswers2(nq->getanswers2()); 98 depth=depth+1;99 100 101 84 } 102 void DialogueManager::clean(){ 103 orxout() <<" depth " << depth << endl; 104 //allQuestions.at(2*depth+1); 105 } 85 106 86 bool DialogueManager::theEnd(){ 107 87 if((currentQuestion->possibleQuestions).empty()) { 108 orxout() << "endtrue" << endl;109 88 return true;} 110 89 else return false; 111 90 } 112 91 113 114 115 /*116 117 118 119 120 121 vector<std::string> DialogueManager::getanswers(void){122 return options;123 }124 125 int DialogueManager::getnumOptions(){126 return options.size();127 }128 129 */130 92 }
Note: See TracChangeset
for help on using the changeset viewer.