Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

SCA_EndObjectActuator.cpp

Go to the documentation of this file.
00001 //
00002 // Remove the actuator's parent when triggered
00003 //
00004 
00005 #include "SCA_IActuator.h"
00006 #include "SCA_EndObjectActuator.h"
00007 #include "SCA_IScene.h"
00008 
00009 
00010 #include <iostream>
00011 
00012 SCA_EndObjectActuator::SCA_EndObjectActuator(SCA_IObject *gameobj, SCA_IScene* scene,PyTypeObject* T)
00013         : SCA_IActuator(gameobj, T),
00014         m_scene(scene)

00015 {
00016     // intentionally empty 
00017 } /* End of constructor */
00018 
00019 SCA_EndObjectActuator::~SCA_EndObjectActuator()

00020 { 
00021         // there's nothing to be done here, really....
00022 } /* end of destructor */
00023 
00024 bool SCA_EndObjectActuator::Update(double curtime,double deltatime)

00025 {
00026         bool result = false;    
00027         bool bNegativeEvent = IsNegativeEvent();
00028 
00029 
00030         
00031         if (bNegativeEvent)
00032                 return false; // do nothing on negative events
00033         m_scene->RemoveObject(GetParent());
00034         
00035         return false;
00036 }
00037 
00038 /* ------------------------------------------------------------------------- */
00039 /* Python functions : integration hooks                                      */
00040 /* ------------------------------------------------------------------------- */
00041 
00042 PyTypeObject SCA_EndObjectActuator::Type = {
00043         PyObject_HEAD_INIT(&PyType_Type)
00044         0,
00045         "SCA_EndObjectActuator",
00046         sizeof(SCA_EndObjectActuator),
00047         0,
00048         PyDestructor,
00049         0,
00050         __getattr,
00051         __setattr,
00052         0, //&MyPyCompare,
00053         __repr,
00054         0, //&cvalue_as_number,
00055         0,
00056         0,
00057         0,
00058         0
00059 };
00060 
00061 PyParentObject SCA_EndObjectActuator::Parents[] = {
00062         &SCA_EndObjectActuator::Type,
00063         &SCA_IActuator::Type,
00064         &SCA_ILogicBrick::Type,
00065         &CValue::Type,
00066         NULL
00067 };
00068 
00069 PyMethodDef SCA_EndObjectActuator::Methods[] = {
00070   {NULL,NULL} //Sentinel
00071 };
00072 
00073 PyObject*
00074 SCA_EndObjectActuator::_getattr(char* attr)

00075 {
00076   _getattr_up(SCA_IActuator);
00077 }
00078 
00079 /* eof */

Generated at Thu Feb 1 13:03:09 2001 for Ketsji Game Engine by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000