Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 27, 2017, 4:57:47 PM (6 years ago)
Author:
maxima
Message:

No more compiler errors. XMLPortObjects not yet implemented.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialog_HS17/src/modules/dialog/Dialog.cc

    r11579 r11607  
    33#include "core/XMLPort.h"
    44#include "core/EventIncludes.h"
     5#include "Dialog.h"
     6#include "Question.h"
    57
    68namespace orxonox
     
    2123                XMLPortParam(Dialog, "name", setName, getName, xmlelement, mode);
    2224                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);
    2426                XMLPortObject(Dialog, Answer, "Answers", addAnswer, getAnswer, xmlelement, mode);
    2527        }
     
    5355
    5456
    55         void Dialog::addQuestion(Question question) //fuegt Question der Map hinzu
     57        void Dialog::addQuestion(Question* question) //fuegt Question der Map hinzu
    5658        {
    57                 //questions_.emplace(question.getQuestionId, question);
     59                //questions_.emplace(question->getQuestionId(), question->getQuestion());
    5860        }
    5961
    60         void Dialog::addAnswer(Answer answer) //fuegt Answer der Map hinzu
     62        void Dialog::addAnswer(Answer* answer) //fuegt Answer der Map hinzu
    6163        {
    62                 //answers_.emplace(std::make_pair(answer.getAnswerId, answer));
     64                //answers_.emplace(std::make_pair(answer->getAnswerId(), answer->getAnswer()));
    6365        }
    6466
    65         std::string Dialog::getQuestion() // returned nichts
     67        Question* Dialog::getQuestion(unsigned int index) const // returned nichts
    6668        {
    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();
    6972        }
    7073
    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.
    7275        {
    73                 return (this->answers_.find(answerId))->second.getAnswer();
     76                return nullptr;
     77                // return (this->answers_.find(answerId))->second.getAnswer();
    7478        }
    7579
Note: See TracChangeset for help on using the changeset viewer.