Embedded Python Module Configuration
I'm looking at adding Python support to my game engine project, with the intent of using it as a scripting language for much of the game logic and world building. I'd like to expose a lot of the C++ code to Python. I've already gone through the relevant documentation on the Python site, and I'm fairly confident that I understand the basic requirements for embedding Python and communicating back and forth between Python and the core engine components.
I'm going to embedding Python into the engine itself, rather than compiling the engine as a Python module, since one of my target platforms is the iPhone.
One question I haven't been able to answer myself is how to introduce structure to the C++ modules. For example, I'd like to be able to do something along the lines of:
from engine.scene import skyobject
import engine.core.platformi开发者_Go百科nfo
Would you just create a single "engine" module, and then add some sort of sub module for scene, core, etc? Or should there be separate modules for each of the exposed components, i.e. defining the skyobject module with the name "engine.scene.skyobject"?
Any insight on this is appreciated.
精彩评论