Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 18, 2017, 2:49:13 PM (7 years ago)
Author:
rrogge
Message:

question updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc

    r11417 r11421  
    2424                //RegisterObject(DialogueManager);
    2525               
    26                
    27 
    2826        }
    2927       
     
    3533
    3634        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                }
    3740                allQuestions.push_back(nq);
     41                        orxout(internal_info) << "qsize " << allQuestions.size();
    3842
    3943        }       
     
    6872                return a2;
    6973        }
    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;
    7279                currentQuestion = currentQuestion->possibleQuestions[0];
    73                 return true;
     80                update(currentQuestion);
     81
     82               
    7483        }
    75         bool DialogueManager::a2clicked(void){
     84        void DialogueManager::a2clicked(void){
    7685                orxout() << "a2 clicked" << endl;
    77                 return true;
     86               
    7887        }
    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         }
    8593
    8694       
    8795
    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;
    90103        }
    91 
    92104       
    93105
Note: See TracChangeset for help on using the changeset viewer.