[Orxonox-commit 6894] r11515 - in code/branches/Dialog_HS17/src/modules: . dialogue_2
kuchlert at orxonox.net
kuchlert at orxonox.net
Mon Oct 30 16:01:48 CET 2017
Author: kuchlert
Date: 2017-10-30 16:01:47 +0100 (Mon, 30 Oct 2017)
New Revision: 11515
Added:
code/branches/Dialog_HS17/src/modules/dialogue_2/
code/branches/Dialog_HS17/src/modules/dialogue_2/Awnser.cc
code/branches/Dialog_HS17/src/modules/dialogue_2/Awnser.h
code/branches/Dialog_HS17/src/modules/dialogue_2/Dialog.cc
code/branches/Dialog_HS17/src/modules/dialogue_2/Dialog.h
code/branches/Dialog_HS17/src/modules/dialogue_2/Question.cc
code/branches/Dialog_HS17/src/modules/dialogue_2/Question.h
Log:
Grundgeruest erstellt
Added: code/branches/Dialog_HS17/src/modules/dialogue_2/Awnser.cc
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialogue_2/Awnser.cc (rev 0)
+++ code/branches/Dialog_HS17/src/modules/dialogue_2/Awnser.cc 2017-10-30 15:01:47 UTC (rev 11515)
@@ -0,0 +1,40 @@
+#include "Awnser.h"
+
+RegisterClass(Awnser);
+
+namespace orxonox{
+
+ // Constructor:
+ Awnser::Awnser(Context* context) : BaseObject(context)
+ {
+ RegisterObject(Awnser);
+ }
+
+ void Awnser::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(Awnser, XMLPort, xmlelement, mode);
+
+ XMLPortParam(Awnser, "awnser", setAwnser, getAwnser, xmlelement, mode);
+ XMLPortParam(Awnser, "nextQuestionId", setNextQuestion, getNextQuestion, xmlelement,mode);
+ }
+
+ void setNextQuestion(std::string nextId)
+ {
+ this->nextQuestionId_ = nextId;
+ }
+
+ std::string getNextQuestion()
+ {
+ return this->nextQuestionId_;
+ }
+
+ void setAwnser(std::string awnser)
+ {
+ this->awnser_ = awnser;
+ }
+
+ std::string getAwnser()
+ {
+ return this->awnser_;
+ }
+}
\ No newline at end of file
Added: code/branches/Dialog_HS17/src/modules/dialogue_2/Awnser.h
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialogue_2/Awnser.h (rev 0)
+++ code/branches/Dialog_HS17/src/modules/dialogue_2/Awnser.h 2017-10-30 15:01:47 UTC (rev 11515)
@@ -0,0 +1,26 @@
+#include "core/BaseObject.h"
+
+#include <string>
+
+namespace orxonox{
+
+
+
+ class Awnser : public BaseObject
+ {
+ public:
+ Awnser(Context* context);
+ virtual ~Awnser();
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ void setNextQuestion(std::string nextId);
+ std::string getNextQuestion();
+
+ void setAwnser(std::string awns);
+ std::string getAwnser();
+
+ private:
+ std::string awnser_;
+ std::string nextQuestionId_;
+ }
+}
Added: code/branches/Dialog_HS17/src/modules/dialogue_2/Dialog.cc
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialogue_2/Dialog.cc (rev 0)
+++ code/branches/Dialog_HS17/src/modules/dialogue_2/Dialog.cc 2017-10-30 15:01:47 UTC (rev 11515)
@@ -0,0 +1,23 @@
+#include "Dialog.h"
+
+RegisterClass(Dialog);
+
+namespace orxonox{
+ //Constructor:
+ Dialog::Dialog(Context* context) : BaseObject(context)
+ {
+ RegisterObjext(Dialog);
+ }
+
+ void Dialog::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(Dialog, XMLPort, xmlelement, mode);
+
+ XMLPortParam(Dialog, "name", setName, getName, xmlelement, mode);
+ XMLPortParam(Dialog, "currentQuestionId", setCurrentQuestion, getCurrentQuestion, xmlelement, mode);
+ XMLPortObject(Dialog, Question, "Questions", addQuestion, getQuestion, xmlelement,mode);
+ XMLPortObject(Dialog, Awnser, "Awnsers", addAwnser, getAwnser, xmlelement, mode);
+ }
+
+
+}
\ No newline at end of file
Added: code/branches/Dialog_HS17/src/modules/dialogue_2/Dialog.h
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialogue_2/Dialog.h (rev 0)
+++ code/branches/Dialog_HS17/src/modules/dialogue_2/Dialog.h 2017-10-30 15:01:47 UTC (rev 11515)
@@ -0,0 +1,37 @@
+#include "core/BaseObject.h"
+#include "Question.h"
+#include "Awnser.h"
+
+#include <string>
+
+namespace orxonox{
+ class Dialog: public BaseObject
+ {
+ public:
+ Dialog(Context* context);
+ virual ~Dialog();
+ virual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ void setName(std::string name);
+ std::string getName();
+
+ void setCurrentQuestionId(std::string questionId)
+ std::string getCurrentQuestionId();
+
+
+ void addQuestion(std::string questionId, Question); //fuegt Question der Map hinzu
+ std::string getQuestion(); // returned nichts
+
+ void addAwnser(std::string awnserId, Awnser); //fuegt Awnser der Map hinzu
+ Awnser getAwnser(); // returned nichts
+
+
+
+
+ private:
+ std::string name_;
+ std::string currentQUestionId_;
+ std::map<std::string, Question> questions_;
+ std::map<std::string, Awnser> awnsers_;
+ }
+}
\ No newline at end of file
Added: code/branches/Dialog_HS17/src/modules/dialogue_2/Question.cc
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialogue_2/Question.cc (rev 0)
+++ code/branches/Dialog_HS17/src/modules/dialogue_2/Question.cc 2017-10-30 15:01:47 UTC (rev 11515)
@@ -0,0 +1,26 @@
+#include "Question.h"
+
+RegisterClass(Question);
+
+namespace orxonox{
+ void setQuestion(std::string question)
+ {
+ this->question_ = question;
+ }
+
+ std::string getQuestion()
+ {
+ return this->question_;
+ }
+
+ void setPossibleAwnsers(std::map<std::string, Awnser> awnsers)
+ {
+ this->awnsers_ = awnsers;
+ }
+
+ std::map<std::string, Awnser> getPossibleAwnsers()
+ {
+ return this->awnsers_;
+ }
+
+}
\ No newline at end of file
Added: code/branches/Dialog_HS17/src/modules/dialogue_2/Question.h
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialogue_2/Question.h (rev 0)
+++ code/branches/Dialog_HS17/src/modules/dialogue_2/Question.h 2017-10-30 15:01:47 UTC (rev 11515)
@@ -0,0 +1,23 @@
+#include "core/BaseObject.h"
+
+#include <string>
+
+namespace orxonox{
+ class Question : public BaseObject
+ {
+ public:
+ Question(Context* context);
+ virtual ~Question();
+ virtual void XMLPort(Element& xmelement, XMLPort::Mode mode);
+
+ void setQuestion(std::string question)
+ std::string getQuestion();
+
+ void addAwnserIds();
+ std::vector<std::string> geAwnserIds();
+
+ private:
+ std::string question_
+ std::vector<std::string> answerIds_;
+ }
+}
\ No newline at end of file
More information about the Orxonox-commit
mailing list