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

SCA_AlwaysSensor.cpp

Go to the documentation of this file.
00001 
00006 
00007 #include "SCA_AlwaysSensor.h"
00008 #include "SCA_LogicManager.h"
00009 #include "SCA_EventManager.h"
00010 
00011 /* ------------------------------------------------------------------------- */
00012 /* Native functions                                                          */
00013 /* ------------------------------------------------------------------------- */
00014 
00015 SCA_AlwaysSensor::SCA_AlwaysSensor(class SCA_EventManager* eventmgr,
00016                                                                  SCA_IObject* gameobj,
00017                                                                  PyTypeObject* T)
00018         : SCA_ISensor(gameobj,eventmgr, T)

00019 {
00020         //SetDrawColor(255,0,0);
00021         m_alwaysresult = true;
00022 }
00023 
00024 bool SCA_AlwaysSensor::Evaluate(CValue* event)

00025 {
00026         /* Nice! :) */
00027                 //return true;
00028         /* even nicer ;) */
00029                 //return false;
00030         
00031         /* nicest ! */
00032         bool result = m_alwaysresult;
00033         m_alwaysresult = false;
00034         return result;
00035 }
00036 
00037 /* ------------------------------------------------------------------------- */
00038 /* Python functions                                                          */
00039 /* ------------------------------------------------------------------------- */
00040 
00041 /* Integration hooks ------------------------------------------------------- */
00042 PyTypeObject SCA_AlwaysSensor::Type = {
00043         PyObject_HEAD_INIT(&PyType_Type)
00044         0,
00045         "SCA_AlwaysSensor",
00046         sizeof(SCA_AlwaysSensor),
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_AlwaysSensor::Parents[] = {
00062         &SCA_AlwaysSensor::Type,
00063         &SCA_ISensor::Type,
00064         &SCA_ILogicBrick::Type,
00065         &CValue::Type,
00066         NULL
00067 };
00068 
00069 PyMethodDef SCA_AlwaysSensor::Methods[] = {
00070         {NULL,NULL} //Sentinel
00071 };
00072 
00073 PyObject* SCA_AlwaysSensor::_getattr(char* attr) {
00074         _getattr_up(SCA_ISensor);
00075 }
00076 
00077 /* 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