remove python2.x support
[blender.git] / source / gameengine / GameLogic / SCA_ORController.cpp
index 29f62b4e6a7f2bb103b444733f6a3a7a1bf35012..12e2f610986c10bc70b0ea508872d9f100abd1f1 100644 (file)
@@ -3,15 +3,12 @@
  *
  * $Id$
  *
- * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License.  See http://www.blender.org/BL/ for information
- * about this.
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,7 +26,7 @@
  *
  * Contributor(s): none yet.
  *
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ * ***** END GPL LICENSE BLOCK *****
  */
 
 #include "SCA_ORController.h"
@@ -45,9 +42,8 @@
 /* Native functions                                                          */
 /* ------------------------------------------------------------------------- */
 
-SCA_ORController::SCA_ORController(SCA_IObject* gameobj,
-                                                                  PyTypeObject* T)
-               :SCA_IController(gameobj, T)
+SCA_ORController::SCA_ORController(SCA_IObject* gameobj)
+               :SCA_IController(gameobj)
 {
 }
 
@@ -63,7 +59,7 @@ CValue* SCA_ORController::GetReplica()
 {
        CValue* replica = new SCA_ORController(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
@@ -79,21 +75,16 @@ void SCA_ORController::Trigger(SCA_LogicManager* logicmgr)
        while ( (!sensorresult) && (!(is==m_linkedsensors.end())) )
        {
                sensor = *is;
-               if (sensor->IsPositiveTrigger()) sensorresult = true;
+               if (sensor->GetState()) sensorresult = true;
                is++;
        }
        
-       CValue* newevent = new CBoolValue(sensorresult);
-
        for (vector<SCA_IActuator*>::const_iterator i=m_linkedactuators.begin();
        !(i==m_linkedactuators.end());i++)
        {
-               SCA_IActuator* actua = *i;//m_linkedactuators.at(i);
-               logicmgr->AddActiveActuator(actua,newevent);
+               SCA_IActuator* actua = *i;
+               logicmgr->AddActiveActuator(actua,sensorresult);
        }
-
-
-       newevent->Release();
 }
 
 /* ------------------------------------------------------------------------- */
@@ -102,38 +93,33 @@ void SCA_ORController::Trigger(SCA_LogicManager* logicmgr)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_ORController::Type = {
-       PyObject_HEAD_INIT(&PyType_Type)
-       0,
+       PyVarObject_HEAD_INIT(NULL, 0)
        "SCA_ORController",
-       sizeof(SCA_ORController),
+       sizeof(PyObjectPlus_Proxy),
        0,
-       PyDestructor,
+       py_base_dealloc,
        0,
-       __getattr,
-       __setattr,
-       0, //&MyPyCompare,
-       __repr,
-       0, //&cvalue_as_number,
        0,
        0,
        0,
-       0
-};
-
-PyParentObject SCA_ORController::Parents[] = {
-       &SCA_ORController::Type,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
        &SCA_IController::Type,
-       &SCA_ILogicBrick::Type,
-       &CValue::Type,
-       NULL
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef SCA_ORController::Methods[] = {
        {NULL,NULL} //Sentinel
 };
 
-PyObject* SCA_ORController::_getattr(const STR_String& attr) {
-       _getattr_up(SCA_IController);
-}
+PyAttributeDef SCA_ORController::Attributes[] = {
+       { NULL }        //Sentinel
+};
 
 /* eof */