Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2017, 9:33:27 AM (6 years ago)
Author:
kuchlert
Message:

fixed addQuestion and addAnswer in Dialog

File:
1 edited

Legend:

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

    r11607 r11611  
    33
    44#include "core/BaseObject.h"
     5#include "DialogPrereqs.h"
    56#include "Question.h"
    67#include "Answer.h"
     
    910#include "overlays/OrxonoxOverlay.h"
    1011
     12#include <map>
     13#include <vector>
    1114#include <string>
    1215
    1316namespace orxonox
    1417{
    15         class Dialog : public BaseObject
     18        class _DialogExport Dialog : public BaseObject
    1619        {
    1720                public:
    1821                        Dialog(Context* context);
    19                         // virtual ~Dialog();
     22
    2023                        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    2124                        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     
    3033                        void addAnswer(Answer* answer); //fuegt Answer der Map hinzu
    3134
    32                         Question* getQuestion(unsigned int index) const; //tolua_export // returned string der momentanen Frage
    33                         Answer* getAnswer(unsigned int index) const; //tolua_export     // returned string der momentanen Frage
    34                         std::vector<std::string> getAnswers(); //tolua_export   // returned vector mit allen momentanen AntwortenIds
     35                        Question* getQuestion(unsigned int index) const; // returned string der momentanen Frage
     36                        Answer* getAnswer(unsigned int index) const; // returned string der momentanen Frage
     37                        std::vector<std::string> getAnswers(); // returned vector mit allen momentanen AntwortenIds
    3538
    3639                        bool execute(bool bTriggered, BaseObject* trigger);
    3740
    38                         void update(std::string givenAnswer);   //tolua_export
     41                        void update(std::string givenAnswer);
    3942
    40                         bool ending(); //tolua_export   //retruned true wenn die Id der Antwort end ist oder keine Antworten auf die frage eingetragen sind
     43                        bool ending(); //retruned true wenn die Id der Antwort end ist oder keine Antworten auf die frage eingetragen sind
    4144
    4245
     
    4447                        std::string name_;
    4548                        std::string currentQuestionId_;
    46                         std::map<std::string, Question> questions_;
    47                         std::map<std::string, Answer> answers_;
     49                        std::map<std::string, Question*> questions_;
     50                        std::map<std::string, Answer*> answers_;
    4851        };
    4952}
Note: See TracChangeset for help on using the changeset viewer.