/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: Benjamin Grauer co-programmer: ... */ #include "load_param_description.h" #include "multi_type.h" #include "debug.h" /** * @param paramName the name of the parameter to load */ LoadParamDescription::LoadParamDescription(const std::string& paramName) : _name(paramName), _parameterCount(0) { } /** * removes all the alocated memory */ LoadParamDescription::~LoadParamDescription() {} /** * @param descriptionText The text to set as a description for this Parameter */ void LoadParamDescription::setDescription(const std::string& descriptionText) { this->_description = descriptionText; } void LoadParamDescription::setValues(unsigned int paramCount, const MultiType* const defaultValues, bool retVal) { this->_parameterCount = paramCount; for (unsigned int i = 0; i < paramCount; ++i) { this->_defaultValues.push_back(defaultValues[i].getString()); this->_types.push_back(MultiType::MultiTypeToString(defaultValues[i].getType())); } } /** * prints out this parameter, its input method and the description (if availiable) */ void LoadParamDescription::print() const { PRINT(0)(" <%s>", this->_name.c_str()); for (unsigned int i = 0; i < this->_parameterCount; i++) { if (i > 0) PRINT(3)(","); // FIXME // switch (this->types[i]) // { // default: // PRINTF(3)("none"); // break; // case ParameterBool: // PRINT(3)("bool"); // break; // case ParameterChar: // PRINT(3)("char"); // break; // case ParameterString: // PRINT(3)("string"); // break; // case ParameterInt: // PRINT(3)("int"); // break; // case ParameterUInt: // PRINT(3)("Uint"); // break; // case ParameterFloat: // PRINT(3)("float"); // break; // case ParameterLong: // PRINT(3)("long"); // break; // case ParameterXML: // PRINT(3)("XML"); // break; // } } PRINT(0)("", this->_name.c_str()); if (!this->_description.empty()) PRINT(0)(" "); PRINT(0)("\n"); }