1 | #include "Question.h" |
---|
2 | |
---|
3 | |
---|
4 | namespace orxonox |
---|
5 | { |
---|
6 | |
---|
7 | RegisterClass(Question); |
---|
8 | |
---|
9 | Question::Question(Context* context) : BaseObject(context) |
---|
10 | { |
---|
11 | RegisterObject(Question); |
---|
12 | } |
---|
13 | |
---|
14 | void Question::XMLPort(Element& xmlement, XMLPort::Mode mode) |
---|
15 | { |
---|
16 | SUPER(Question, XMLPort, xmlement, mode); |
---|
17 | |
---|
18 | XMLPortParam(Question, "question", setQuestion, getQuestion, xmlement, mode); |
---|
19 | XMLPortParam(Question, "Id", setQuestionId, getQuestionId, xmlement, mode); |
---|
20 | |
---|
21 | XMLPortObject(Question, AnswerId, "answers", addAnswerId, getAnswerIds, xmlement, mode); |
---|
22 | } |
---|
23 | |
---|
24 | void Question::setQuestionId(std::string Id) |
---|
25 | { |
---|
26 | this->questionId_ = Id; |
---|
27 | } |
---|
28 | |
---|
29 | std::string Question::getQuestionId() |
---|
30 | { |
---|
31 | return this->questionId_; |
---|
32 | } |
---|
33 | |
---|
34 | void Question::setQuestion(std::string question) |
---|
35 | { |
---|
36 | this->question_ = question; |
---|
37 | } |
---|
38 | |
---|
39 | cstd::string Question::getQuestion() |
---|
40 | { |
---|
41 | return this->question_; |
---|
42 | } |
---|
43 | |
---|
44 | void Question::addAnswerId(AnswerId answerId) |
---|
45 | { |
---|
46 | this->answerIds_.push_back(answerId.getId); |
---|
47 | } |
---|
48 | |
---|
49 | |
---|
50 | std::vector<std::string> Question::getAnswerIds() |
---|
51 | { |
---|
52 | return this->answerIds_; |
---|
53 | } |
---|
54 | |
---|
55 | } |
---|