Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/modules/objects/triggers/EventMultiTrigger.h @ 7482

Last change on this file since 7482 was 7301, checked in by dafrick, 14 years ago

Improving documentation for MultiTriggers, also some small bugfixes, simplifications and added features.

  • Property svn:eol-style set to native
File size: 2.9 KB
RevLine 
[6864]1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Damian 'Mozork' Frick
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file EventMultiTrigger.h
31    @brief Definition of the EventMultiTrigger class.
32*/
33
34#ifndef _EventMultiTrigger_H__
35#define _EventMultiTrigger_H__
36
37#include "objects/ObjectsPrereqs.h"
38
39#include "MultiTrigger.h"
40
41namespace orxonox
42{
43
[7301]44    /**
45    @brief
46        The EventMultiTrigger class is the equivalent of the EventTrigger class for MultiTriggers.
47        Consequentially what it does is it provides a way to have a MultiTrigger triggered by any kinds of events.
48        Events that are not caused by a MultiTrigger or by a MultiTrigger with an originator that is no target of this EventMultiTrigger are broadcasted to all entities that are the target of this EventMultitrigger. Events that are caused by MultiTriggers with an originator that is a target of this EventMultiTrigger just trigger the EventMultiTrigger for the originator that caused the MultiTrigger to trigger. Thus showing the equivalent behavior to the EventTrigger.
49
50        Example:
51        @code
52        <EventMultiTrigger invert="true">
53            <events>
54                <trigger>
55                    <MultiTrigger ... />
56                    <EventListener ... />
57                </trigger>
58            </events>
59        </EventMultiTrigger>
60        @endcode
61    @see MultiTrigger.h
62        For more information on MultiTriggers.
63    @author
64        Damian 'Mozork' Frick
65    */
[6864]66    class _ObjectsExport EventMultiTrigger : public MultiTrigger
67    {
[7163]68
[6864]69        public:
[7301]70            EventMultiTrigger(BaseObject* creator); //!< Constructor. Registers the object.
71            virtual ~EventMultiTrigger(); //!< Destructor.
[6864]72
73            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an EventMultiTrigger object through XML.
74            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
75
[7301]76        private:
77            void trigger(bool bTriggered, BaseObject* originator); //!< Method that causes the EventMultiTrigger to trigger upon receiving an event.
[6864]78
79    };
80
81}
82
83#endif // _EventMultiTrigger_H__
Note: See TracBrowser for help on using the repository browser.