Changeset 1502 for code/trunk/src/core/ConfigValueIncludes.h
- Timestamp:
- Jun 1, 2008, 3:54:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/ConfigValueIncludes.h
r1062 r1502 57 57 58 58 /** 59 @brief Assigns the value, defined in the config-file, to the variable (or the default-value, if there is no entry in the file). 60 @param classname name in which the config value should be stored 61 @param varname The name of the variable 62 @param defvalue The default-value of the variable 63 */ 64 #define SetConfigValueGeneric(classname, varname, defvalue) \ 65 orxonox::ConfigValueContainer* container##varname = ClassManager<classname>::getIdentifier()->getConfigValueContainer(#varname); \ 66 if (!container##varname) \ 67 { \ 68 container##varname = new orxonox::ConfigValueContainer(CFT_Settings, ClassManager<classname>::getIdentifier(), #varname, varname = defvalue); \ 69 ClassManager<classname>::getIdentifier()->addConfigValueContainer(#varname, container##varname); \ 70 } \ 71 container##varname->getValue(&varname) 72 73 /** 59 74 @brief Assigns the vector-values, defined in the config-file, to the vector (or the default-value, if there are no entries in the file). 60 75 @param varname The name of the std::vector … … 69 84 temp.push_back(MultiTypeMath(defvalue[i])); \ 70 85 container##varname = new orxonox::ConfigValueContainer(CFT_Settings, this->getIdentifier(), #varname, temp); \ 86 container##varname->setVectorType(varname); \ 71 87 this->getIdentifier()->addConfigValueContainer(#varname, container##varname); \ 72 88 } \ … … 106 122 } 107 123 108 /**109 @brief Assigns the command, defined in the keybind-file, to the key-variable (or an empty string, if there is no entry in the file).110 @param varname The name of the key-variable111 */112 #define SetKeybind(keyname) \113 orxonox::ConfigValueContainer* container##keyname = this->getIdentifier()->getConfigValueContainer(#keyname); \114 if (!container##keyname) \115 { \116 container##keyname = new orxonox::ConfigValueContainer(CFT_Keybindings, this->getIdentifier(), #keyname, keyname = ""); \117 this->getIdentifier()->addConfigValueContainer(#keyname, container##keyname); \118 } \119 container##keyname->getValue(&varname)120 121 124 #endif /* _ConfigValueIncludes_H__ */
Note: See TracChangeset
for help on using the changeset viewer.