Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 6, 2009, 4:56:42 AM (15 years ago)
Author:
landauf
Message:

Added support for named events (so one object can fire multiple different events).
Added a new class, EventFilter, to filter differently named events and map them to different states.

I've wrapped the event names with a pretty useless macro, but I want to expand this in the future and register possible event names in the Identifier of the corresponding class. This allows us to get the possible event names in a static manner and thus build an editor upon it.

File:
1 edited

Legend:

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

    r5879 r5888  
    4040    struct _CoreExport Event
    4141    {
    42         Event(bool activate, BaseObject* originator) : activate_(activate), originator_(originator) {}
     42        Event(bool activate, BaseObject* originator, const std::string& name) : activate_(activate), originator_(originator), name_(name) {}
    4343
    4444        bool        activate_;   //!< True if this is an activating event (the event source was inactive before and just triggered the event) - false otherwise
    4545        std::string statename_;  //!< The name of the state this event affects
    4646        BaseObject* originator_; //!< The object which triggered this event
     47        std::string name_;       //!< The name of this event
    4748    };
    4849
Note: See TracChangeset for help on using the changeset viewer.