Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8300 in orxonox.OLD for branches/script_engine/src/lib/util/executor


Ignore:
Timestamp:
Jun 9, 2006, 4:20:36 PM (18 years ago)
Author:
bensch
Message:

script_engine: fixed the LoadParam-Bug that prevented loading of two Parameters

Location:
branches/script_engine/src/lib/util/executor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/script_engine/src/lib/util/executor/executor.h

    r8271 r8300  
    3333 *  Objects of any Class (Templated)
    3434 *  Default Values
    35  *  Functions with up to 5 parameters (more seems useless)
     35 *  Functions with up to 5 parameters (more seems overhead, split up the function)
    3636 *  Functions with many types (@see functor_list.h)
    3737 */
  • branches/script_engine/src/lib/util/executor/executor_functional.cc

    r8035 r8300  
    1515
    1616#include "executor.h"
    17 
    18 std::string ExecutorFunctional_returningString_from;
    19 std::string ExecutorFunctional_returningString_default;
     17std::string ExecutorFunctional_returningString_from[5];
    2018
    2119
     
    3230template<> float fromString<float>(const std::string& input, float defaultValue) { return isFloat(input, defaultValue); };
    3331template<> char fromString<char>(const std::string& input, char defaultValue) { return isInt(input, defaultValue); };
    34 template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue) { return ExecutorFunctional_returningString_from = isString(input, defaultValue); };
     32template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue) { return (input.size() > 0) ? input : defaultValue; };
    3533
    3634
     
    4846template<> float getDefault<float>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getFloat(); };
    4947template<> char getDefault<char>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getChar(); };
    50 template<> const std::string& getDefault<const std::string&>(const MultiType* const defaultValues, unsigned int i) { return ExecutorFunctional_returningString_default = defaultValues[i].getString(); };
     48template<> const std::string& getDefault<const std::string&>(const MultiType* const defaultValues, unsigned int i) { return ExecutorFunctional_returningString_from[i] = defaultValues[i].getString(); };
    5149
    5250
Note: See TracChangeset for help on using the changeset viewer.