View Single Post
Onag

JCF Member

Joined: Feb 2002

Posts: 165

Onag is doing well so far

May 18, 2005, 10:31 PM
Onag is offline
Reply With Quote
Here's an example (though not a very good one) of where IMovable would be useful:

A mine explodes, sending a shockwave throughout the surrounding area. In this area, you have the player, some baddies, some ammo lying around, and a large, half-burried rock.

You would want everything but the rock to move. One easy way to handle this is to check all objects in the shock-wave to see if they implement IMovable, then move them accordingly.

We could put the location data and move method in a class, but .NET limits us to single inheritance outside of interfaces, so we have to be careful about what we put in base classes.

IObjectState can go. I was misinterpreting the meaning of IUdatable. Also, IRenderable is a must, but I don't think it should have any implied reference to a graphic resource. This would limit its capabilities.

-Nag

Last edited by Onag; May 23, 2005 at 10:29 PM.