[847] | 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" |
---|
[869] | 30 | #include "Loader.h" |
---|
[878] | 31 | #include "Namespace.h" |
---|
| 32 | #include "CoreIncludes.h" |
---|
[847] | 33 | |
---|
| 34 | namespace orxonox |
---|
| 35 | { |
---|
[856] | 36 | // ############################### |
---|
| 37 | // ### XMLPortParamContainer ### |
---|
| 38 | // ############################### |
---|
[847] | 39 | XMLPortParamContainer::XMLPortParamContainer() |
---|
| 40 | { |
---|
| 41 | this->bAddedDescription_ = false; |
---|
| 42 | this->bAddedDefaultValues_ = false; |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | XMLPortParamContainer& XMLPortParamContainer::description(const std::string description) |
---|
| 46 | { |
---|
| 47 | if (!this->bAddedDescription_) |
---|
| 48 | { |
---|
| 49 | this->description_ = std::string("XMLPortParamContainer::" + this->classname_ + "::" + this->paramname_); |
---|
| 50 | AddLanguageEntry(this->description_, description); |
---|
| 51 | this->bAddedDescription_ = true; |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | return (*this); |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | const std::string& XMLPortParamContainer::getDescription() |
---|
| 58 | { |
---|
| 59 | return GetLocalisation(this->description_); |
---|
| 60 | } |
---|
[856] | 61 | |
---|
| 62 | |
---|
| 63 | // ################################ |
---|
| 64 | // ### XMLPortObjectContainer ### |
---|
| 65 | // ################################ |
---|
| 66 | XMLPortObjectContainer::XMLPortObjectContainer() |
---|
| 67 | { |
---|
| 68 | this->bAddedDescription_ = false; |
---|
[878] | 69 | this->bApplyLoaderMask_ = false; |
---|
[856] | 70 | } |
---|
| 71 | |
---|
| 72 | XMLPortObjectContainer& XMLPortObjectContainer::description(const std::string description) |
---|
| 73 | { |
---|
| 74 | if (!this->bAddedDescription_) |
---|
| 75 | { |
---|
| 76 | this->description_ = std::string("XMLPortObjectContainer::" + this->classname_ + "::" + this->sectionname_); |
---|
| 77 | AddLanguageEntry(this->description_, description); |
---|
| 78 | this->bAddedDescription_ = true; |
---|
| 79 | } |
---|
| 80 | |
---|
| 81 | return (*this); |
---|
| 82 | } |
---|
| 83 | |
---|
| 84 | const std::string& XMLPortObjectContainer::getDescription() |
---|
| 85 | { |
---|
| 86 | return GetLocalisation(this->description_); |
---|
| 87 | } |
---|
[869] | 88 | |
---|
| 89 | bool XMLPortObjectContainer::identifierIsIncludedInLoaderMask(const Identifier* identifier) |
---|
| 90 | { |
---|
[878] | 91 | return ((!this->bApplyLoaderMask_) || identifier->isA(Class(Namespace)) || Loader::currentMask_s.isIncluded(identifier)); |
---|
[869] | 92 | } |
---|
[847] | 93 | } |
---|