Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2007, 5:37:26 PM (16 years ago)
Author:
landauf
Message:

added a config-file-parser and a makro ( SetConfigValue(variable, defaultvalue) ) to get user-modified values from the config-file (or to write the defaultvalue into it if the variable isn't yet in the file).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/objects/test3.cc

    r383 r434  
    1010    {
    1111        RegisterObject(Test3);
     12
     13        this->setConfigValues();
     14    }
     15
     16    void Test3::setConfigValues()
     17    {
     18        SetConfigValue(value_int_, -100);
     19        SetConfigValue(value_double_, 10.555678);
     20        SetConfigValue(value_bool_, true);
     21        SetConfigValue(value_string_, "Dies ist ein Test");
     22        SetConfigValue(value_vector3_, Vector3(13, 26, 39));
     23        SetConfigValue(value_colourvalue_, ColourValue(1.0, 0.5, 0.25, 0.887));
    1224    }
    1325
     
    1527    {
    1628    }
     29
     30    void Test3::configOutput()
     31    {
     32        std::cout << this->value_int_ << std::endl;
     33        std::cout << this->value_double_ << std::endl;
     34        std::cout << this->value_bool_ << std::endl;
     35        std::cout << this->value_string_ << std::endl;
     36        std::cout << this->value_vector3_ << std::endl;
     37        std::cout << this->value_colourvalue_ << std::endl;
     38    }
     39
    1740        #define testandcout(code) \
    1841          std::cout << #code << " " << code << "\n"
Note: See TracChangeset for help on using the changeset viewer.