adonthell-devel
[Top][All Lists]
Advanced

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

Re: [Adonthell-devel] inventory news


From: Alexandre Courbot
Subject: Re: [Adonthell-devel] inventory news
Date: 26 Apr 2002 11:27:19 +0200

> Oh, and we'll certainly need a method to iterate over an inventory. That
> would be useful for saving, but is also needed for an inventory GUI
> later on.

Right. Using the classic C++ iterator system would certainly be fine.

> > The item_base class consists of the following:
> [...]
> > - types: is a list of types (picking up Kai's suggestion) the
> >           item belongs to (a torch can be a weapon and a lightsource)
> >           The names of the types are the names of the corresponding
> >           Python-files that are used for the action methods
> 
> That's clever. :)

Yep, fine! We should try as much as possible not to access these
attributes too often though, as there is an undetermined number of them,
and they are strings (for example, we should check whether something is
a weapon not every time we use it to hit, but only once when it is
equipped).

> Well, all in all that's a good start. Not long and we can think about
> integrating things into the engine. (Have you already thought about
> handling items on the map, Alex?)

Yes, a little bit already. You would have a map_item class that would
inherit from map_moving. It would be linked to the base_item class by a
classical pointer. Or maybe it's the base_item that should own the
map_placeable. Either way, it won't be very hard to pick/drop them.

Alex.
-- 
http://www.gnurou.org





reply via email to

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