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.

Location:
code/branches/core5/src/orxonox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc

    r5857 r5879  
    7171    }
    7272
    73     void ParticleSpawner::processEvent(Event& event)
     73    void ParticleSpawner::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
    7474    {
    75         SUPER(ParticleSpawner, processEvent, event);
     75        SUPER(ParticleSpawner, XMLEventPort, xmlelement, mode);
    7676
    77         ORXONOX_SET_EVENT(ParticleSpawner, "spawn", spawn, event);
     77        XMLPortEventState(ParticleSpawner, BaseObject, "spawn", spawn, xmlelement, mode);
    7878    }
    7979
  • code/branches/core5/src/orxonox/graphics/ParticleSpawner.h

    r5831 r5879  
    4444
    4545            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    46             virtual void processEvent(Event& event);
     46            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
    4747
    4848            inline void stop(bool bDestroy)
  • code/branches/core5/src/orxonox/overlays/OrxonoxOverlay.h

    r3327 r5879  
    213213  };
    214214
    215   SUPER_FUNCTION(7, OrxonoxOverlay, changedOwner, false);
    216   SUPER_FUNCTION(8, OrxonoxOverlay, changedOverlayGroup, false);
     215  SUPER_FUNCTION(6, OrxonoxOverlay, changedOwner, false);
     216  SUPER_FUNCTION(7, OrxonoxOverlay, changedOverlayGroup, false);
    217217}
    218218
  • code/branches/core5/src/orxonox/worldentities/WorldEntity.cc

    r5801 r5879  
    175175    void WorldEntity::registerVariables()
    176176    {
    177         registerVariable(this->mainStateName_,  VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainState));
     177        registerVariable(this->mainStateName_,  VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainStateName));
    178178
    179179        registerVariable(this->bActive_,        VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
Note: See TracChangeset for help on using the changeset viewer.