Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/GameLogic/SCA_EndObjectActuator.cpp
- This file was moved from source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp.
| Show All 19 Lines | |||||
| * | * | ||||
| * The Original Code is: all of this file. | * The Original Code is: all of this file. | ||||
| * | * | ||||
| * Contributor(s): none yet. | * Contributor(s): none yet. | ||||
| * | * | ||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp | /** \file gameengine/GameLogic/SCA_EndObjectActuator.cpp | ||||
| * \ingroup ketsji | * \ingroup gamelogic | ||||
| */ | */ | ||||
| // | // | ||||
| // Remove the actuator's parent when triggered | // Remove the actuator's parent when triggered | ||||
| // | // | ||||
| // Previously existed as: | // Previously existed as: | ||||
| // \source\gameengine\GameLogic\SCA_EndObjectActuator.cpp | // \source\gameengine\GameLogic\SCA_EndObjectActuator.cpp | ||||
| // Please look here for revision history. | // Please look here for revision history. | ||||
| #include "SCA_IActuator.h" | #include "SCA_IActuator.h" | ||||
| #include "KX_SCA_EndObjectActuator.h" | #include "SCA_EndObjectActuator.h" | ||||
| #include "SCA_IScene.h" | #include "SCA_IScene.h" | ||||
| KX_SCA_EndObjectActuator::KX_SCA_EndObjectActuator(SCA_IObject *gameobj, | SCA_EndObjectActuator::SCA_EndObjectActuator(SCA_IObject *gameobj, | ||||
| SCA_IScene* scene): | SCA_IScene* scene): | ||||
| SCA_IActuator(gameobj, KX_ACT_END_OBJECT), | SCA_IActuator(gameobj, SCA_ACT_END_OBJECT), | ||||
| m_scene(scene) | m_scene(scene) | ||||
| { | { | ||||
| // intentionally empty | // intentionally empty | ||||
| } /* End of constructor */ | } /* End of constructor */ | ||||
| KX_SCA_EndObjectActuator::~KX_SCA_EndObjectActuator() | SCA_EndObjectActuator::~SCA_EndObjectActuator() | ||||
| { | { | ||||
| // there's nothing to be done here, really.... | // there's nothing to be done here, really.... | ||||
| } /* end of destructor */ | } /* end of destructor */ | ||||
| bool KX_SCA_EndObjectActuator::Update() | bool SCA_EndObjectActuator::Update() | ||||
| { | { | ||||
| // bool result = false; /*unused*/ | // bool result = false; /*unused*/ | ||||
| bool bNegativeEvent = IsNegativeEvent(); | bool bNegativeEvent = IsNegativeEvent(); | ||||
| RemoveAllEvents(); | RemoveAllEvents(); | ||||
| if (bNegativeEvent) | if (bNegativeEvent) | ||||
| return false; // do nothing on negative events | return false; // do nothing on negative events | ||||
| m_scene->DelayedRemoveObject(GetParent()); | m_scene->DelayedRemoveObject(GetParent()); | ||||
| return false; | return false; | ||||
| } | } | ||||
| CValue* KX_SCA_EndObjectActuator::GetReplica() | CValue* SCA_EndObjectActuator::GetReplica() | ||||
| { | { | ||||
| KX_SCA_EndObjectActuator* replica = | SCA_EndObjectActuator* replica = new SCA_EndObjectActuator(*this); | ||||
| new KX_SCA_EndObjectActuator(*this); | |||||
| if (replica == NULL) return NULL; | if (replica == NULL) return NULL; | ||||
| replica->ProcessReplica(); | replica->ProcessReplica(); | ||||
| return replica; | return replica; | ||||
| }; | } | ||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| /* ------------------------------------------------------------------------- */ | /* ------------------------------------------------------------------------- */ | ||||
| /* Python functions : integration hooks */ | /* Python functions : integration hooks */ | ||||
| /* ------------------------------------------------------------------------- */ | /* ------------------------------------------------------------------------- */ | ||||
| PyTypeObject KX_SCA_EndObjectActuator::Type = { | PyTypeObject SCA_EndObjectActuator::Type = { | ||||
| PyVarObject_HEAD_INIT(NULL, 0) | PyVarObject_HEAD_INIT(NULL, 0) | ||||
| "KX_SCA_EndObjectActuator", | "SCA_EndObjectActuator", | ||||
| sizeof(PyObjectPlus_Proxy), | sizeof(PyObjectPlus_Proxy), | ||||
| 0, | 0, | ||||
| py_base_dealloc, | py_base_dealloc, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| py_base_repr, | py_base_repr, | ||||
| 0,0,0,0,0,0,0,0,0, | 0,0,0,0,0,0,0,0,0, | ||||
| Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, | ||||
| 0,0,0,0,0,0,0, | 0,0,0,0,0,0,0, | ||||
| Methods, | Methods, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| &SCA_IActuator::Type, | &SCA_IActuator::Type, | ||||
| 0,0,0,0,0,0, | 0,0,0,0,0,0, | ||||
| py_base_new | py_base_new | ||||
| }; | }; | ||||
| PyMethodDef KX_SCA_EndObjectActuator::Methods[] = { | PyMethodDef SCA_EndObjectActuator::Methods[] = { | ||||
| {NULL,NULL} //Sentinel | {NULL,NULL} //Sentinel | ||||
| }; | }; | ||||
| PyAttributeDef KX_SCA_EndObjectActuator::Attributes[] = { | PyAttributeDef SCA_EndObjectActuator::Attributes[] = { | ||||
| { NULL } //Sentinel | { NULL } //Sentinel | ||||
| }; | }; | ||||
| #endif // WITH_PYTHON | #endif // WITH_PYTHON | ||||
| /* eof */ | /* eof */ | ||||