Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/script_triggers/action_trigger.h @ 10771

Last change on this file since 10771 was 10638, checked in by snellen, 18 years ago

Merged inputdevice-branch back to trunk: New ScriptTrigger (ActionTrigger) available

File size: 1.1 KB
Line 
1/*!
2 * @file action_trigger.h
3 *  triggeres a script when a world_entity is in range and the player has pressed the action button
4 */
5
6#ifndef _ACTION_TRIGGER_H
7#define _ACTION_TRIGGER_H
8
9#include <string>
10
11#include "script.h"
12#include "script_class.h"
13#include "script_trigger.h"
14#include "event_listener.h"
15
16class ActionTrigger : public ScriptTrigger, public EventListener
17{
18  ObjectListDeclaration(ActionTrigger);
19 
20  public:
21    ActionTrigger(const TiXmlElement* root = NULL);
22    ~ActionTrigger();
23   
24    ///LOADING
25    virtual void loadParams(const TiXmlElement* root);
26
27
28    /// DO WORK
29    virtual void process( const Event &event);
30    virtual void tick(float timestep);
31
32    /// SET MEMBER
33    void setTarget(const std::string& targetName);
34    void setTarget(WorldEntity* target) { if(target!=NULL) this->target=target; }
35    void setInvert(const bool inv) { this->invert = invert; }
36    void setRadius(const float radius) { if(radius>0) this->radius = radius; }
37
38
39  private:
40    bool          actionScheduled;
41    WorldEntity*  target;
42    bool          invert;
43    float         radius;
44
45
46};
47
48
49#endif
Note: See TracBrowser for help on using the repository browser.