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/CommandEvaluation.h

    r1505 r1716  
    3737#include "ArgumentCompletionListElement.h"
    3838#include "util/SubString.h"
    39 #include "util/MultiTypeMath.h"
     39#include "util/MultiType.h"
    4040
    4141namespace orxonox
     
    8181                { return (this->additionalParameter_ != "") ? (" " + this->additionalParameter_) : ""; }
    8282
    83             void setEvaluatedParameter(unsigned int index, MultiTypeMath param);
    84             MultiTypeMath getEvaluatedParameter(unsigned int index) const;
     83            void setEvaluatedParameter(unsigned int index, MultiType param);
     84            MultiType getEvaluatedParameter(unsigned int index) const;
    8585
    8686            bool hasReturnvalue() const;
    87             MultiTypeMath getReturnvalue() const;
     87            MultiType getReturnvalue() const;
    8888
    8989        private:
     
    115115
    116116            bool bEvaluatedParams_;
    117             MultiTypeMath param_[5];
     117            MultiType param_[5];
    118118    };
    119119}
Note: See TracChangeset for help on using the changeset viewer.