[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] item test code

From: Kai Sterker
Subject: [Adonthell-devel] item test code
Date: Mon, 13 Jan 2003 00:28:15 +0100

I sat down and coded a small part of the item class as described in the
earlier mail. Just enough to get the torch example running. It's in CVS,
main branch, called

Since I didn't want to pollute the 0.3 branch with test code, I have
revived pydonthell (which is little more than a python interpreter that
knows about the adonthell module): src/tools/pydonthell

Sadly, the current implementation has huge problems: if I extend
item_base on python side, SWIG does not know that my item class is
derived from item_base. So if I want to call a method of item_base from
within the derived class, it fails with a type error.

Which means we can practically forget about that way of doing it. The
only halfway decent workaround might be to pass item_base to the
constructor of each python item class, so it can at least store a
pointer to it.

However, it's time for me to go to sleep, so I won't do this today.
Anyway, attached are the scripts I made. Happy segfaulting! To test
them, get the new code from CVS,, configure --enable-tools,
make and make install.

Then extract the attached python scripts in src/tools/pydonthell and run
'pydonthell'. That's it.


Attachment: item-test.tar.gz
Description: GNU Zip compressed data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]