Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 6, 2008, 4:21:56 PM (16 years ago)
Author:
landauf
Message:

Added new 'MultiType', replacing MultiTypePrimitive, MultiTypeString and MultiTypeMath. MultiType can hold all types MultiTypeMath was able to hold, namely all primitives, pointers, string and several math objects (vector2, 3 and 4, quaternion, colourvalue, radian, degree).

The new MultiType has a completely changed behaviour, I'll explain this on a wiki page somewhen.
But to say the most important things in a few words:
The MultiType has a fixed type. This type is determined by the first assigned value (by using setValue(value), operator=(value) or MultiType(value)). Every other value getting assigned later, will be converted to the first type. But you can change the type (setType<T>()), convert the value (convert<T>()) or force the type of a newly assigned value manually (setValue<T>(value)) by using template functions.

In contrast, the old MultiTypeMath changed it's internal type whenever a new type was assigned. So be aware of this important change.

At the moment I can't see any issues, but there might very well be several problems yet to discover, so further tests will be done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core3/src/core/ConsoleCommand.h

    r1594 r1716  
    9393            inline ConsoleCommand& descriptionReturnvalue(const std::string& description)
    9494                { this->ExecutorStatic::setDescriptionReturnvalue(description); return (*this); }
    95             inline ConsoleCommand& defaultValues(const MultiTypeMath& param1)
     95            inline ConsoleCommand& defaultValues(const MultiType& param1)
    9696                { this->ExecutorStatic::setDefaultValues(param1); return (*this); }
    97             inline ConsoleCommand& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2)
     97            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2)
    9898                { this->ExecutorStatic::setDefaultValues(param1, param2); return (*this); }
    99             inline ConsoleCommand& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)
     99            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3)
    100100                { this->ExecutorStatic::setDefaultValues(param1, param2, param3); return (*this); }
    101             inline ConsoleCommand& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)
     101            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4)
    102102                { this->ExecutorStatic::setDefaultValues(param1, param2, param3, param4); return (*this); }
    103             inline ConsoleCommand& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)
     103            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5)
    104104                { this->ExecutorStatic::setDefaultValues(param1, param2, param3, param4, param5); return (*this); }
    105             inline ConsoleCommand& defaultValue(unsigned int index, const MultiTypeMath& param)
     105            inline ConsoleCommand& defaultValue(unsigned int index, const MultiType& param)
    106106                { this->ExecutorStatic::setDefaultValue(index, param); return (*this); }
    107107
Note: See TracChangeset for help on using the changeset viewer.