Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Adding all classes in modules/objects to Objects module (in doxygen).
Created TriggerBase which is the base class of Trigger and MultiTrigger and now provides the shared functionality and data.
Updated some of the documentation in MultiTrigger and Script.

  • Property svn:eol-style set to native
File size: 3.2 KB
Line 
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    @ingroup MultiTrigger
33*/
34
35#ifndef _EventMultiTrigger_H__
36#define _EventMultiTrigger_H__
37
38#include "objects/ObjectsPrereqs.h"
39
40#include "MultiTrigger.h"
41
42namespace orxonox
43{
44
45    /**
46    @brief
47        The EventMultiTrigger class is the equivalent of the @ref orxonox::EventTrigger "EventTrigger" class for MultiTriggers.
48        Consequentially what it does is it provides a way to have a MultiTrigger triggered by any kinds of @ref orxonox::Event "Events".
49        @ref orxonox::Event "Events" that are not caused by a MultiTrigger, or that are caused 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. @ref orxonox::Event "Events" that are caused by @ref orxonox::MultiTrigger "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 @ref orxonox::EventTrigger "EventTrigger".
50
51        Example:
52        @code
53        <EventMultiTrigger invert="true">
54            <events>
55                <trigger>
56                    <MultiTrigger ... />
57                    <EventListener ... />
58                </trigger>
59            </events>
60        </EventMultiTrigger>
61        @endcode
62
63    @see MultiTrigger
64        For more information on MultiTriggers.
65
66    @author
67        Damian 'Mozork' Frick
68
69    @ingroup MultiTrigger
70    */
71    class _ObjectsExport EventMultiTrigger : public MultiTrigger
72    {
73
74        public:
75            EventMultiTrigger(BaseObject* creator); //!< Constructor. Registers the object.
76            virtual ~EventMultiTrigger(); //!< Destructor.
77
78            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an EventMultiTrigger object through XML.
79            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
80
81        private:
82            void trigger(bool bTriggered, BaseObject* originator); //!< Method that causes the EventMultiTrigger to trigger upon receiving an @ref orxonox::Event "Event".
83
84    };
85
86}
87
88#endif // _EventMultiTrigger_H__
Note: See TracBrowser for help on using the repository browser.