Hi,

Im really scared because I fear a fundamental issue concerning the script
system in my game engine.


In C++, I have a class. In my class I map data to GameObject like:

*class
{
    map<GameObject*, Data> .....
}*

As you see, I use the pointer as key.

When I from c++, in the same class, call a python function I pass the key
like this:

*class::callPythonFunctions()
{

boost::python::get_override("callbackFunction")(boost::python::object(boost::python::ptr(gameobject)));
// the variable gameobj is of type GameObject*
}
*
When I recieve the call in python I do some checks like this:

*def callbackFunction(self, gameobj):
   for x in self.mydict.keys():
     print("Checking")
     print(gameobj == self.mydict)
     print(gameobj in self.mydict)*


The above will print something like:
*....
Checking
True
False
...*

I do have a overloaded == operator. But how can I fix so that python checks
for my pointer and not the PyObject* pointer ?

// Simon
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to