adonthell-devel
[Top][All Lists]
Advanced

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

[Adonthell-devel] character class


From: Mike Avery
Subject: [Adonthell-devel] character class
Date: Wed, 21 May 2003 09:16:12 -0700

Sorry to switch gears here totally Kai.  The character class implementation
really is a pretty heavy requirement for the manager class.  Just makes
sense to me to get the chracter stuff in palce first.  I hope I'm not
pissing you off!  I'm jumping all over the place as I read and come to
understand existing code, so I may seem a bit flippant until I'm
comfortable.

I'm looking at the stuff in char-test/character/  and comparing to what is
in place on the C++ side.  The Pythion stuff is much further advanced
obviously as we discussed earlier.  So how do you envision the character
class implemented?

A C++ skeleton with python extending the class for specific
races/creatures/party members, or do you want the core rules reflected in
C++ (stats, attributes), with creature/character/party attributes defined in
python files?  If you could give me a rundown on how you want the character
class implemented I could take what is already there and bring the
c++/Pythno sides up to speed.  Then I would feel more comfortable looking at
manager stuff since we have something to manage!




> -----Original Message-----
> From: Mike Avery 
> Sent: Wednesday, May 21, 2003 11:55 AM
> To: 'Programmers playground'
> Subject: RE: [Adonthell-devel] Python question
> 
> 
> > You will probably want to make that structure known to Python 
> > by adding
> > it to the py_adonthell.i file. Usually, it'll be enough to 
> > add #include
> > "yourclass.h" respectively %include "yourclass.h" at the 
> > proper places.
> > (You'll see where what needs to go).
> 
> So I define the structure in manager.h and it will get 
> included in the shadow manager class when I use
> Manager = adonthel.manager().  I can then interact with the 
> class as I would in C++, only using python syntax, correct?
> 
>  
> > Afterwards, upon running make, SWIG will create a wrapper for your
> > structure and the matching Python shadow class.
> > 
> > When calling your get_char_snapshot from the manager, 
> you'll get that
> > shadow class, which encapsulates your original C++ object. 
> It'll have
> > all the attributes your C++ class has and can be used in 
> the same way.
> > And of course, your C++ object will reflect the changes 
> made to that 
> > shadow object.
> > 
> > Btw, that shadow class ends up being defined in 
> modules/adonthell.py.
> > See there for more info about what is going on.
> 
> Ah, OK.  I see how it works now.  I was looking at stuff in 
> src/adonthell and src/tools/pydonthell and I wasn't seeing 
> how things were tied together.  It's clearer now, thanks.
> 
> I may be getting ahead of myself here.  I think I had better 
> look at the character class first.  It seems to be a skeleton 
> right now.  Working on get_char_snapshot() without first 
> having a working character class seems backwards :)
> 
> I think we need the character, item and inv classes sorted 
> out before we can really be productive in building the 
> manager.  Your prototype looks great!  I think we end up 
> doing work trying to fudge the missing functionality in the 
> related classes.
> 
> I'm going to switch modes and look at having the C++ and 
> Pyton character classes reflect the current status of what we 
> want.  Is that OK?
> 
> Mike
> 




reply via email to

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