Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file was 10638, checked in by snellen, 17 years ago

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

File size: 1.1 KB
RevLine 
[10630]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
[10631]6#ifndef _ACTION_TRIGGER_H
7#define _ACTION_TRIGGER_H
[10630]8
9#include <string>
10
11#include "script.h"
12#include "script_class.h"
13#include "script_trigger.h"
[10634]14#include "event_listener.h"
[10630]15
[10634]16class ActionTrigger : public ScriptTrigger, public EventListener
[10630]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
[10634]29    virtual void process( const Event &event);
[10630]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.