|| ||"Ivan Illarionov" <ivan.illarionov-AT-gmail.com>|
|| ||dev-talk <wesnoth-dev-AT-gna.org>|
|| ||Wesnoth refactoring and future direction plan|
|| ||Mon, 5 Jan 2009 11:58:52 +0300|
|| ||Article, Thread
WESNOTH REFACTORING AND FUTURE DIRECTION PLAN
1. Disable current Python AI code and add new integrated Python interpreter
in a form of C++ class.
Proof of concept: http://github.com/ii/wesnoth/tree/master/src/wespython.hpp
Python will be re-enabled on top of new interpreter and new bindings.
The limited scope of the current interpreter don't allow to use it,
2. Add --python or similar option to wesnoth executable which activates
the new interpreter and redirects the execution to the GameController object
written in Python. This object exists as PyObject* pointer inside C++ and
it is created by PyImport_Import/PyObject_GetAttrString/PyObject_CallObject
Python/C API calls.
During refactoring phase which could take some time new changes will be visible
only with this option the same way --new-widgets option works now.
3. GameController object will do the same job as the current game_controller
C++ class but with a twist:
Game is separated into several "modules": each module is a Python package with
WML config files.
By default "titlescreen" module is loaded, --test and --campaign options will
run the "game" module bypassing the title screen. Pressing the buttons on the
title screen will load required modules like "game" or "editor".
4. All game would be converted to these python modules step by step by exposing
all C++ functionality to Python. Majority of exising C++ code will be re-used
in a form of Python extensions.
5. After the conversion is finished it would simply become the default mode.
to post comments)