Re: Inheritance and the collision handler

jon klein <[email protected]> Thu, 28 Jul 2005 09:31:30 -0400
Newsgroups gmane.comp.breve
Message-ID <[email protected]>
On Jul 26, 2005, at 3:28 AM, Thies Pfeiffer wrote:

> Hi,
>
> I just encountered a problem when preparing the course-material for  
> our AI course
> (which of course is based on breve ;-) ):
> The "handle-collisions", which expects the name of a type to be  
> specified as string,
> does not respect inheritance, or does it? The problem occured when  
> we provided a base class
> for agents the students could subclass. In this situation we do not  
> know the name of their agent
> beforehand, but some of the auxiliary objects need to handle  
> collisions with the agents.
> Therefore we would need the name of their subclass with the current  
> implementation
> to handle-collisions. But it would be nice if we just could say:  
> handle-collisions "OURBASECLASS"
> and the subclasses will also be caught (following the inheritance  
> tree).
>
> Hmm. I hope you did get the point ;-)

I'll look into adding this.  I actually seem to remember not having  
it this way for a reason,
but alas, I can't seem to remember what that reason was :).  It would  
make sense to implement it
as you describe it.

In the meantime, the workaround would probably be to add the  
collision handler in the base
class itself, via its init method.

> By the way: the documentation seems to need some updates. Some of  
> the examples are
> only fractionary and e.g. the vector and its subcomponents are not  
> sufficiently described.

If you could take note of the problems as you come across them and  
send me a list, it will
help me to get them fixed quickly.

- jon klein
_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve