Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 29, 2010, 1:16:16 PM (14 years ago)
Author:
dafrick
Message:

Created a new class of triggers called Multitriggers.
MultiTriggers are triggers which (as opposed to normal triggers) have a state for each object triggering the MultiTrigger, that means, that a MultiTrigger can be triggered for two different Players, while not being triggered for a third.
To go with this MultiTrigger I created a data structure (MultitriggerContainer), which helps relaying important information to the objects, that receive the Events of the trigger.
Also there is a MultiDistanceTrigger, which is just the DistanceTrigger as a MultiTrigger.

To make this work I had to make some adjustements to the eventsystem, namely an EventState can now be either an EventState (as it was before) or an EventSink, which means that every efent arriving at the EventState is processed as opposed to just the ones which change the state.
There is a new makro (XMLPortEventSink) to create an EventState with sink behaviour. It can be used exacly as the XMLPortEventState makro.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/BaseObject.cc

    r6524 r6800  
    103103        }
    104104    }
     105   
     106    /** @brief Adds an object which listens to the events of this object. */
     107    void BaseObject::registerEventListener(BaseObject* object)
     108    {
     109        COUT(4) << "New EventListener: " << object->getIdentifier()->getName() << " &(" << object << ")." << std::endl;
     110        this->eventListeners_.insert(object);
     111    }
    105112
    106113    /**
     
    356363    {
    357364        this->registerEventStates();
     365       
     366        COUT(4) << this->getIdentifier()->getName() << " (&" << this << ") processing event. originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << "), activate: " << event.activate_ << ", name: " << event.name_ << ", statename: " << event.statename_ << "." << std::endl;
    358367
    359368        std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(event.statename_);
Note: See TracChangeset for help on using the changeset viewer.