1 | /* |
---|
2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | * |
---|
4 | * |
---|
5 | * License notice: |
---|
6 | * |
---|
7 | * This program is free software; you can redistribute it and/or |
---|
8 | * modify it under the terms of the GNU General Public License |
---|
9 | * as published by the Free Software Foundation; either version 2 |
---|
10 | * of the License, or (at your option) any later version. |
---|
11 | * |
---|
12 | * This program is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * GNU General Public License for more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU General Public License |
---|
18 | * along with this program; if not, write to the Free Software |
---|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
20 | * |
---|
21 | * Author: |
---|
22 | * Fabian 'x3n' Landau |
---|
23 | * Co-authors: |
---|
24 | * ... |
---|
25 | * |
---|
26 | */ |
---|
27 | |
---|
28 | #include "XMLPort.h" |
---|
29 | #include "Language.h" |
---|
30 | #include "Loader.h" |
---|
31 | |
---|
32 | namespace orxonox |
---|
33 | { |
---|
34 | // ############################### |
---|
35 | // ### XMLPortParamContainer ### |
---|
36 | // ############################### |
---|
37 | XMLPortParamContainer::XMLPortParamContainer() |
---|
38 | { |
---|
39 | this->bAddedDescription_ = false; |
---|
40 | this->bAddedDefaultValues_ = false; |
---|
41 | } |
---|
42 | |
---|
43 | XMLPortParamContainer& XMLPortParamContainer::description(const std::string description) |
---|
44 | { |
---|
45 | if (!this->bAddedDescription_) |
---|
46 | { |
---|
47 | this->description_ = std::string("XMLPortParamContainer::" + this->classname_ + "::" + this->paramname_); |
---|
48 | AddLanguageEntry(this->description_, description); |
---|
49 | this->bAddedDescription_ = true; |
---|
50 | } |
---|
51 | |
---|
52 | return (*this); |
---|
53 | } |
---|
54 | |
---|
55 | const std::string& XMLPortParamContainer::getDescription() |
---|
56 | { |
---|
57 | return GetLocalisation(this->description_); |
---|
58 | } |
---|
59 | |
---|
60 | |
---|
61 | // ################################ |
---|
62 | // ### XMLPortObjectContainer ### |
---|
63 | // ################################ |
---|
64 | XMLPortObjectContainer::XMLPortObjectContainer() |
---|
65 | { |
---|
66 | this->bAddedDescription_ = false; |
---|
67 | } |
---|
68 | |
---|
69 | XMLPortObjectContainer& XMLPortObjectContainer::description(const std::string description) |
---|
70 | { |
---|
71 | if (!this->bAddedDescription_) |
---|
72 | { |
---|
73 | this->description_ = std::string("XMLPortObjectContainer::" + this->classname_ + "::" + this->sectionname_); |
---|
74 | AddLanguageEntry(this->description_, description); |
---|
75 | this->bAddedDescription_ = true; |
---|
76 | } |
---|
77 | |
---|
78 | return (*this); |
---|
79 | } |
---|
80 | |
---|
81 | const std::string& XMLPortObjectContainer::getDescription() |
---|
82 | { |
---|
83 | return GetLocalisation(this->description_); |
---|
84 | } |
---|
85 | |
---|
86 | bool XMLPortObjectContainer::identifierIsIncludedInLoaderMask(const Identifier* identifier) |
---|
87 | { |
---|
88 | return Loader::currentMask_s.isIncluded(identifier); |
---|
89 | } |
---|
90 | } |
---|