Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 29, 2010, 1:16:16 PM (15 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.

Location:
code/trunk/src/modules/objects
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/objects/ObjectsPrereqs.h

    r5929 r6800  
    8585    // triggers
    8686    class CheckPoint;
     87    class DistanceMultiTrigger;
    8788    class DistanceTrigger;
    8889    class EventTrigger;
     90    class MultiTrigger;
     91    class MultiTriggerContainer;
    8992    class Trigger;
    9093}
  • code/trunk/src/modules/objects/eventsystem/EventListener.cc

    r6417 r6800  
    6161            return;
    6262        }
     63       
     64        COUT(4) << "EventListener: Processing event: originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << ")" << ", activate: " << event.activate_ << ", name: " << event.name_ << std::endl;
    6365
    6466        this->bActive_ = true;
  • code/trunk/src/modules/objects/triggers/CMakeLists.txt

    r5781 r6800  
    11ADD_SOURCE_FILES(OBJECTS_SRC_FILES
    2   Trigger.cc
     2  CheckPoint.cc
     3  DistanceMultiTrigger.cc
    34  DistanceTrigger.cc
    45  EventTrigger.cc
    5   CheckPoint.cc
     6  MultiTrigger.cc
     7  MultiTriggerContainer.cc
     8  Trigger.cc
    69)
Note: See TracChangeset for help on using the changeset viewer.