BGE Python API cleanup - no functionality changes
[blender.git] / source / gameengine / Ketsji / KX_ConstraintWrapper.cpp
index c9095ff34f669393118ecdbd0d702f30e2f96650..d557758461624e339f7a5c13ecc6fc6fffffcc9a 100644 (file)
@@ -69,22 +69,22 @@ PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* self,
 
 //python specific stuff
 PyTypeObject KX_ConstraintWrapper::Type = {
-       PyObject_HEAD_INIT(&PyType_Type)
+       PyObject_HEAD_INIT(NULL)
                0,
                "KX_ConstraintWrapper",
-               sizeof(KX_ConstraintWrapper),
+               sizeof(PyObjectPlus_Proxy),
                0,
-               PyDestructor,
+               py_base_dealloc,
                0,
-               __getattr,
-               __setattr,
-               0, //&MyPyCompare,
-               __repr,
-               0, //&cvalue_as_number,
                0,
                0,
                0,
-               0
+               py_base_repr,
+               0,0,0,0,0,0,
+               py_base_getattro,
+               py_base_setattro,
+               0,0,0,0,0,0,0,0,0,
+               Methods
 };
 
 PyParentObject KX_ConstraintWrapper::Parents[] = {
@@ -92,37 +92,35 @@ PyParentObject KX_ConstraintWrapper::Parents[] = {
        NULL
 };
 
-PyObject*      KX_ConstraintWrapper::_getattr(const STR_String& attr)
+PyObject*      KX_ConstraintWrapper::py_getattro(PyObject *attr)
 {
        //here you can search for existing data members (like mass,friction etc.)
-       _getattr_up(PyObjectPlus);
+       py_getattro_up(PyObjectPlus);
 }
 
-int    KX_ConstraintWrapper::_setattr(const STR_String& attr,PyObject* pyobj)
+int    KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* pyobj)
 {
-       
-       PyTypeObject* type = pyobj->ob_type;
        int result = 1;
-
-       if (type == &PyList_Type)
+       /* what the heck is this supposed to do?, needs attention */
+       if (PyList_Check(pyobj))
        {
                result = 0;
        }
-       if (type == &PyFloat_Type)
+       if (PyFloat_Check(pyobj))
        {
                result = 0;
 
        }
-       if (type == &PyInt_Type)
+       if (PyInt_Check(pyobj))
        {
                result = 0;
        }
-       if (type == &PyString_Type)
+       if (PyString_Check(pyobj))
        {
                result = 0;
        }
        if (result)
-               result = PyObjectPlus::_setattr(attr,pyobj);
+               result = PyObjectPlus::py_setattro(attr,pyobj);
        return result;
 };
 
@@ -132,3 +130,7 @@ PyMethodDef KX_ConstraintWrapper::Methods[] = {
        {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_VARARGS},
        {NULL,NULL} //Sentinel
 };
+
+PyAttributeDef KX_ConstraintWrapper::Attributes[] = {
+       { NULL }        //Sentinel
+};