Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 28, 2007, 2:41:13 AM (16 years ago)
Author:
landauf
Message:

added function to add descriptions to config values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/ConfigValueContainer.h

    r704 r705  
    5151#include "OgreVector3.h"
    5252#include "OgreColourValue.h"
     53#include "Language.h"
    5354
    5455namespace orxonox
     
    105106
    106107            /** @returns the value. @param value This is only needed to determine the right type. */
    107             inline int getValue(int value)                                      { return this->value_.value_int_; }
     108            inline ConfigValueContainer& getValue(int& value)                           { value = this->value_.value_int_; return *this; }
    108109            /** @returns the value. @param value This is only needed to determine the right type. */
    109             inline unsigned int getValue(unsigned int value)                    { return this->value_.value_uint_; }
     110            inline ConfigValueContainer& getValue(unsigned int& value)                  { value = this->value_.value_uint_; return *this; }
    110111            /** @returns the value. @param value This is only needed to determine the right type. */
    111             inline char getValue(char value)                                    { return this->value_.value_char_; }
     112            inline ConfigValueContainer& getValue(char& value)                          { value = this->value_.value_char_; return *this; }
    112113            /** @returns the value. @param value This is only needed to determine the right type. */
    113             inline unsigned char getValue(unsigned char value)                  { return this->value_.value_uchar_; }
     114            inline ConfigValueContainer& getValue(unsigned char& value)                 { value = this->value_.value_uchar_; return *this; }
    114115            /** @returns the value. @param value This is only needed to determine the right type. */
    115             inline float getValue(float value)                                  { return this->value_.value_float_; }
     116            inline ConfigValueContainer& getValue(float& value)                         { value = this->value_.value_float_; return *this; }
    116117            /** @returns the value. @param value This is only needed to determine the right type. */
    117             inline double getValue(double value)                                { return this->value_.value_double_; }
     118            inline ConfigValueContainer& getValue(double& value)                        { value = this->value_.value_double_; return *this; }
    118119            /** @returns the value. @param value This is only needed to determine the right type. */
    119             inline double getValue(long double value)                           { return this->value_.value_long_double_; }
     120            inline ConfigValueContainer& getValue(long double& value)                   { value = this->value_.value_long_double_; return *this; }
    120121            /** @returns the value. @param value This is only needed to determine the right type. */
    121             inline bool getValue(bool value)                                    { return this->value_.value_bool_; }
     122            inline ConfigValueContainer& getValue(bool& value)                          { value = this->value_.value_bool_; return *this; }
    122123            /** @returns the value. @param value This is only needed to determine the right type. */
    123             inline const std::string& getValue(const std::string& value)        { return this->value_string_; }
     124            inline ConfigValueContainer& getValue(std::string& value)                   { value = this->value_string_; return *this; }
    124125            /** @returns the value. @param value This is only needed to determine the right type. */
    125             inline const char* getValue(const char* value)                      { return this->value_string_.c_str(); }
     126            inline ConfigValueContainer& getValue(const char* value)                    { value = this->value_string_.c_str(); return *this; }
    126127            /** @returns the value. @param value This is only needed to determine the right type. */
    127             inline Ogre::Vector2 getValue(const Ogre::Vector2& value)           { return this->value_vector2_; }
     128            inline ConfigValueContainer& getValue(Ogre::Vector2& value)                 { value = this->value_vector2_; return *this; }
    128129            /** @returns the value. @param value This is only needed to determine the right type. */
    129             inline Ogre::Vector3 getValue(const Ogre::Vector3& value)           { return this->value_vector3_; }
     130            inline ConfigValueContainer& getValue(Ogre::Vector3& value)                 { value = this->value_vector3_; return *this; }
    130131            /** @returns the value. @param value This is only needed to determine the right type. */
    131             inline Ogre::ColourValue getValue(const Ogre::ColourValue& value)   { return this->value_colourvalue_; }
     132            inline ConfigValueContainer& getValue(Ogre::ColourValue& value)             { value = this->value_colourvalue_; return *this; }
     133
     134            void description(const std::string& description);
    132135
    133136            bool parseSting(const std::string& input);
     
    186189
    187190            VariableType type_;                                 //!< The type of the variable
     191            bool bAddedDescription_;                            //!< True if a description was added
     192            LanguageEntryName description_;                     //!< The description
    188193    };
    189194}
Note: See TracChangeset for help on using the changeset viewer.