|
Last change
on this file since 10652 was
10622,
checked in by snellen, 19 years ago
|
|
merged scriptimprovements back to trunk
|
|
File size:
1.0 KB
|
| Line | |
|---|
| 1 | /*! |
|---|
| 2 | * @file space_trigger.h |
|---|
| 3 | * triggeres a script when a world_entity is in range |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | #ifndef _SPACE_TRIGGER_H |
|---|
| 7 | #define _SPACE_TRIGGER_H |
|---|
| 8 | |
|---|
| 9 | #include <string> |
|---|
| 10 | |
|---|
| 11 | #include "script.h" |
|---|
| 12 | #include "script_class.h" |
|---|
| 13 | #include "script_trigger.h" |
|---|
| 14 | |
|---|
| 15 | class SpaceTrigger : public ScriptTrigger |
|---|
| 16 | { |
|---|
| 17 | ObjectListDeclaration(SpaceTrigger); |
|---|
| 18 | |
|---|
| 19 | public: |
|---|
| 20 | SpaceTrigger(const TiXmlElement* root = NULL); |
|---|
| 21 | ~SpaceTrigger(); |
|---|
| 22 | |
|---|
| 23 | ///LOADING |
|---|
| 24 | virtual void loadParams(const TiXmlElement* root); |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | /// DO WORK |
|---|
| 28 | virtual void tick(float timestep); |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | /// SET MEMBER |
|---|
| 32 | void setTarget(const std::string& targetName); |
|---|
| 33 | void setTarget(WorldEntity* target) { if(target!=NULL) this->target=target; } |
|---|
| 34 | void setTriggerRemains(const bool lasts) { this->triggerRemains = lasts; } |
|---|
| 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 | |
|---|
| 41 | WorldEntity* target; |
|---|
| 42 | bool triggerRemains; |
|---|
| 43 | bool invert; |
|---|
| 44 | float radius; |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | }; |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | #endif |
|---|
Note: See
TracBrowser
for help on using the repository browser.