Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 5, 2009, 5:02:25 PM (15 years ago)
Author:
landauf
Message:

More changes in the event-system: processEvent() is now locally executed in BaseObject. The event states (like activity, visibility, …) are now defined in XMLEventPort, a function which closely resembles XMLPort. This function is used to define event states and to parse event sources from XML.

Connected the main-state directly with the event-system. After a state was declared as the "main state", the Functor from the corresponding EventState-object is used to call the function. This reduces the redundancy of declaring event-states and main-states separately. Of course only boolean event-states (like activity or visibility) can be used as main-state, while memoryless states (like spawn in ParticleSpawner) and individual states which need the triggering object (like execute in QuestEffectBeacon) won't work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/OrxonoxClass.h

    r5823 r5879  
    110110                Returns NULL if the no pointer was found.
    111111            */
    112             template <class T>
    113             FORCEINLINE T* getDerivedPointer(unsigned int classID)
     112            FORCEINLINE void* getDerivedPointer(unsigned int classID)
    114113            {
    115114                for (int i = this->objectPointers_.size() - 1; i >= 0; --i)
    116115                {
    117116                    if (this->objectPointers_[i].first == classID)
    118                         return static_cast<T*>(this->objectPointers_[i].second);
     117                        return this->objectPointers_[i].second;
    119118                }
    120119                return NULL;
    121120            }
    122             //! Const version of getDerivedPointer
    123             template <class T>
    124             FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
    125             {
    126                 return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID);
    127             }
     121
     122            //! Version of getDerivedPointer with template
     123            template <class T> FORCEINLINE T* getDerivedPointer(unsigned int classID)
     124            {   return static_cast<T*>(this->getDerivedPointer(classID));   }
     125            //! Const version of getDerivedPointer with template
     126            template <class T> FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
     127            {   return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID);   }
    128128
    129129        private:
Note: See TracChangeset for help on using the changeset viewer.