Changeset 10614 in orxonox.OLD
- Timestamp:
- Mar 30, 2007, 11:35:30 AM (18 years ago)
- Location:
- branches/scriptimprovements/src/world_entities/script_triggers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/scriptimprovements/src/world_entities/script_triggers/script_trigger.cc
r10610 r10614 41 41 executionStopped = false; // true when something goes wrong and the trigger has to be stopped 42 42 addToScript = false; 43 44 45 if(root != NULL)46 {47 48 loadParams(root);49 50 if(addToScript && scriptIsOk)51 {52 script->addObject( "ScriptTrigger", this->getName());53 }54 55 }56 43 57 44 } -
branches/scriptimprovements/src/world_entities/script_triggers/script_trigger.h
r10611 r10614 11 11 #include "world_entity.h" 12 12 #include "loading/load_param.h" 13 #include "vector.h"14 13 #include "script_manager.h" 15 14 #include "script.h" 16 #include "script_class.h" 15 17 16 18 17 class ScriptTrigger : public WorldEntity … … 28 27 29 28 /// DO WORK 30 virtual void tick(float timestep) {}29 virtual void tick(float timestep) = 0; 31 30 virtual void executeAction(float timestep); 32 31 void testScriptingFramework(); … … 48 47 std::string functionName; 49 48 bool doDebugDraw; 50 bool addToScript;49 51 50 52 51 //for internal use … … 59 58 bool scriptIsOk; 60 59 bool scriptFinished; 60 bool addToScript; 61 61 62 62 }; -
branches/scriptimprovements/src/world_entities/script_triggers/space_trigger.cc
r10611 r10614 30 30 ->addMethod("setName", Executor1<BaseObject, lua_State*, const std::string&>(&BaseObject::setName)) 31 31 ->addMethod("setTarget", Executor1<SpaceTrigger, lua_State*, const std::string&>(&SpaceTrigger::setTarget)) 32 ->addMethod("setTriggerParent", Executor1<S paceTrigger, lua_State*, const std::string&>(&SpaceTrigger::setTriggerParent))32 ->addMethod("setTriggerParent", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setTriggerParent)) 33 33 ->addMethod("setTriggerRemains", Executor1<SpaceTrigger, lua_State*, bool>(&SpaceTrigger::setTriggerRemains)) 34 34 ->addMethod("setInvert", Executor1<SpaceTrigger, lua_State*, bool>(&SpaceTrigger::setInvert)) 35 35 ->addMethod("setRadius", Executor1<SpaceTrigger, lua_State*, float>(&SpaceTrigger::setRadius)) 36 ->addMethod("setScript", Executor1<S paceTrigger, lua_State*, const std::string&>(&SpaceTrigger::setScript))37 ->addMethod("setFunction", Executor1<S paceTrigger, lua_State*, const std::string&>(&SpaceTrigger::setFunction))38 ->addMethod("setDebugDraw", Executor1<S paceTrigger, lua_State*, bool>(&SpaceTrigger::setDebugDraw))39 ->addMethod("setAddToScript", Executor1<S paceTrigger, lua_State*, bool>(&SpaceTrigger::setAddToScript))36 ->addMethod("setScript", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setScript)) 37 ->addMethod("setFunction", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setFunction)) 38 ->addMethod("setDebugDraw", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setDebugDraw)) 39 ->addMethod("setAddToScript", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setAddToScript)) 40 40 ); 41 41 … … 55 55 triggerRemains = true; 56 56 57 if(root != NULL) 58 { 59 loadParams(root); 57 60 61 if(addToScript && scriptIsOk) 62 { 63 script->addObject( "SpaceTrigger", this->getName()); 64 } 65 66 } 58 67 59 68 } -
branches/scriptimprovements/src/world_entities/script_triggers/tick_trigger.cc
r10611 r10614 45 45 this->toList(OM_COMMON); 46 46 47 if(root != NULL) 48 { 49 loadParams(root); 50 51 if(addToScript && scriptIsOk) 52 { 53 script->addObject( "TickTrigger", this->getName()); 54 } 55 56 } 57 47 58 } 48 59
Note: See TracChangeset
for help on using the changeset viewer.