Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Presentation_HS17_merge/src/modules/dialog/Question.cc @ 11756

Last change on this file since 11756 was 11750, checked in by landauf, 7 years ago

[Dialog_HS17] cleanup XMLPort collection getters

File size: 2.1 KB
RevLine 
[11749]1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      ...
24 *   Co-authors:
25 *      ...
26 *
27 */
28
[11579]29#include "Question.h"
[11611]30#include "core/CoreIncludes.h"
[11579]31
32namespace orxonox
33{
34
35        RegisterClass(Question);
36
37        Question::Question(Context* context) : BaseObject(context)
38        {
39                RegisterObject(Question);
40        }
41
42        void Question::XMLPort(Element& xmlement, XMLPort::Mode mode)
43        {
44                SUPER(Question, XMLPort, xmlement, mode);
45
46                XMLPortParam(Question, "question", setQuestion, getQuestion, xmlement, mode);
47                XMLPortParam(Question, "Id", setQuestionId, getQuestionId, xmlement, mode);
48
[11642]49                XMLPortObject(Question, AnswerId, "answerIds", addAnswerId, getAnswerId, xmlement, mode);
[11579]50        }
51
[11644]52        void Question::setQuestionId(const std::string& Id)
[11579]53        {
54                this->questionId_ = Id;
55        }
56
[11644]57        const std::string& Question::getQuestionId() const
[11579]58        {
59                return this->questionId_;
60        }
61
[11644]62        void Question::setQuestion(const std::string& question)
[11579]63        {
64                this->question_ = question;
65        }
66
[11644]67        const std::string& Question::getQuestion() const
[11579]68        {
69                return this->question_;
70        }
71
[11607]72        void Question::addAnswerId(AnswerId* answerId)
[11579]73        {
[11607]74                this->answerIds_.push_back(answerId->getId());
[11579]75        }
76
[11750]77        AnswerId* Question::getAnswerId(unsigned int index) const
[11607]78        {
79                return nullptr;
80        }
[11579]81
[11750]82        const std::vector<std::string>& Question::getAnswerIds() const
[11579]83        {
[11750]84                return this->answerIds_;
[11579]85        }
86       
[11749]87}
Note: See TracBrowser for help on using the repository browser.