Changeset 11421 for code/branches/Dialogue_FS17/src
- Timestamp:
- May 18, 2017, 2:49:13 PM (7 years ago)
- Location:
- code/branches/Dialogue_FS17/src/modules/dialogue
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
r11417 r11421 24 24 //RegisterObject(DialogueManager); 25 25 26 27 28 26 } 29 27 … … 35 33 36 34 void DialogueManager::registerquestion(NextQuestion* nq){ 35 if(allQuestions.size()==0) { 36 orxout(internal_info) << "At least one NextQuestion has to be set." << endl; 37 } else { 38 currentQuestion = allQuestions[0]; 39 } 37 40 allQuestions.push_back(nq); 41 orxout(internal_info) << "qsize " << allQuestions.size(); 38 42 39 43 } … … 68 72 return a2; 69 73 } 70 bool DialogueManager::a1clicked(void){ 71 orxout() << "a1 clicked" << endl; 74 void DialogueManager::a1clicked(void){ 75 76 assert((currentQuestion->retposQues())[0]); 77 orxout() << "a14 clicked" << endl; 78 orxout() << currentQuestion->possibleQuestions[0] << endl; 72 79 currentQuestion = currentQuestion->possibleQuestions[0]; 73 return true; 80 update(currentQuestion); 81 82 74 83 } 75 boolDialogueManager::a2clicked(void){84 void DialogueManager::a2clicked(void){ 76 85 orxout() << "a2 clicked" << endl; 77 return true;86 78 87 } 79 /*void DialogueManager::XMLPort(Element& xmlelement, XMLPort::Mode mode) 80 { 81 SUPER(DialogueManager, XMLPort, xmlelement, mode); 82 83 XMLPortParam(DialogueManager, "question", setquestion, getquestion, xmlelement, mode); 84 }*/ 88 void DialogueManager::update(NextQuestion* nq){ 89 this->setquestion(nq->getquestion()); 90 this->setanswers1(nq->getanswers1()); 91 this->setanswers2(nq->getanswers2()); 92 } 85 93 86 94 87 95 88 /*std::string DialogueManager::setnpc(std::string npc){ 89 return npc; 96 97 98 /* 99 100 bool DialogueManager::theEnd(){ 101 if(currentQuestion->retposQues()) return true; 102 else return false; 90 103 } 91 92 104 93 105 -
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
r11417 r11421 46 46 std::string getanswers1(void); //tolua_export 47 47 std::string getanswers2(void); //tolua_export 48 bool a1clicked(void); //tolua_export 49 bool a2clicked(void); //tolua_export 50 /*std::string setnpc(std::string npc); 48 void a1clicked(void); //tolua_export 49 void a2clicked(void); //tolua_export 50 //bool theEnd(); 51 void update(NextQuestion* nq); 51 52 52 void setanswers(std::string option1, std::string option2, std::string option3);53 std::vector <std::string> getanswers(void);54 55 int getnumOptions();56 57 58 59 std::string npc;60 std::vector<std::string> options;61 62 */63 53 private: 64 54 NextQuestion* currentQuestion; -
code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc
r11417 r11421 48 48 i--; 49 49 } 50 return nullptr; } 50 return nullptr; 51 } 51 52 52 53 //XML and Event stuff … … 112 113 } 113 114 115 std::vector<NextQuestion*> NextQuestion::retposQues(){ 116 orxout() << "fish" << endl; 117 assert(possibleQuestions[0]); 118 orxout() << possibleQuestions.size() << endl; 119 return possibleQuestions; 120 } 114 121 115 /*NextQuestion NextQuestion::compare(){116 DialogueManager& m = DialogueManager::getInstance();117 if(m.a1clicked()){118 return *possibleQuestions[0];119 }120 122 121 else if(m.a2clicked()){ 122 return *possibleQuestions[1]; 123 } 123 /* 124 124 125 }*/ 125 126 -
code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h
r11417 r11421 10 10 #include "core/EventIncludes.h" 11 11 #include "DialoguePrereqs.h" 12 13 14 12 15 13 … … 47 45 48 46 std::vector<NextQuestion*> possibleQuestions; 47 std::vector<NextQuestion*> retposQues(); 49 48 private: 50 49 std::string a1;
Note: See TracChangeset
for help on using the changeset viewer.