Last change
on this file since 8261 was
8246,
checked in by snellen, 19 years ago
|
moved example.cc to scripttrigger, object.cc, account.cc
|
File size:
1.3 KB
|
Line | |
---|
1 | #ifndef _SCRIPT_TRIGGER_H |
---|
2 | #define _SCRIPT_TRIGGER_H |
---|
3 | |
---|
4 | #include <string> |
---|
5 | |
---|
6 | #include "world_entity.h" |
---|
7 | #include "loading/load_param.h" |
---|
8 | #include "vector.h" |
---|
9 | #include "script_manager.h" |
---|
10 | #include "script.h" |
---|
11 | |
---|
12 | class ScriptTrigger : public WorldEntity |
---|
13 | { |
---|
14 | public: |
---|
15 | ScriptTrigger(const TiXmlElement* root = NULL); |
---|
16 | ~ScriptTrigger(); |
---|
17 | |
---|
18 | ///LOADING |
---|
19 | virtual void loadParams(const TiXmlElement* root); |
---|
20 | |
---|
21 | |
---|
22 | /// DO WORK |
---|
23 | virtual void tick(float timestep); |
---|
24 | virtual void executeAction(); |
---|
25 | void testScriptingFramework(); |
---|
26 | |
---|
27 | /// SET MEMBER |
---|
28 | void setTarget(const std::string& targetName); |
---|
29 | void setTarget(WorldEntity* target) { if(target!=NULL) this->target=target; } |
---|
30 | void setTriggerParent(const std::string& name); |
---|
31 | void setCallOnce(const bool call) { this->callOnce = call; } |
---|
32 | void setRadius(const float radius) { if(radius>0) this->radius = radius; } |
---|
33 | void setDelay(const float time){if(delay>0) this->delay = delay; } |
---|
34 | void setScript(const std::string& file); |
---|
35 | void setFunction(const std::string& function){ this->functionName = function; } |
---|
36 | |
---|
37 | |
---|
38 | private: |
---|
39 | |
---|
40 | WorldEntity* target; |
---|
41 | bool callOnce; |
---|
42 | float radius; |
---|
43 | float delay; |
---|
44 | Script* script; |
---|
45 | std::string functionName; |
---|
46 | |
---|
47 | //for internal use |
---|
48 | bool scriptCalled; |
---|
49 | bool scriptIsOk; |
---|
50 | |
---|
51 | }; |
---|
52 | |
---|
53 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.