Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 11783 was 11782, checked in by landauf, 7 years ago

tabs → spaces

  • Property svn:eol-style set to native
File size: 2.2 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
[11782]35    RegisterClass(Question);
[11579]36
[11782]37    Question::Question(Context* context) : BaseObject(context)
38    {
39        RegisterObject(Question);
40    }
[11579]41
[11782]42    void Question::XMLPort(Element& xmlement, XMLPort::Mode mode)
43    {
44        SUPER(Question, XMLPort, xmlement, mode);
[11579]45
[11782]46        XMLPortParam(Question, "question", setQuestion, getQuestion, xmlement, mode);
47        XMLPortParam(Question, "Id", setQuestionId, getQuestionId, xmlement, mode);
[11579]48
[11782]49        XMLPortObject(Question, AnswerId, "answerIds", addAnswerId, getAnswerId, xmlement, mode);
50    }
[11579]51
[11782]52    void Question::setQuestionId(const std::string& Id)
53    {
54        this->questionId_ = Id;
55    }
[11579]56
[11782]57    const std::string& Question::getQuestionId() const
58    {
59        return this->questionId_;
60    }
[11579]61
[11782]62    void Question::setQuestion(const std::string& question)
63    {
64        this->question_ = question;
65    }
[11579]66
[11782]67    const std::string& Question::getQuestion() const
68    {
69        return this->question_;
70    }
[11579]71
[11782]72    void Question::addAnswerId(AnswerId* answerId)
73    {
74        this->answerIds_.push_back(answerId->getId());
75    }
[11579]76
[11782]77    AnswerId* Question::getAnswerId(unsigned int index) const
78    {
79        return nullptr;
80    }
[11579]81
[11782]82    const std::vector<std::string>& Question::getAnswerIds() const
83    {
84        return this->answerIds_;
85    }
[11749]86}
Note: See TracBrowser for help on using the repository browser.