|
![](/i/fill.gif) |
Christian Froeschlin wrote:
> Darren New wrote:
>
>> There's no way to make a "collection of objects that implement
>> IGameComponent, IDrawable, and IUpdatable" as far as I know.
>
> I suppose you could subclass a collection of IGameComponents
> and add run-time type checks to only allow adding objects which
> also implement IDrawable and IUpdatable.
Yeah. I think I'm just going to make it an array of objects, and only act on
the ones that have the right routines defined.
Unfortunately, GameComponent also implements a whole bunch of stuff that
isn't in the interfaces, like LoadContent (for loading textures and such
whenever the screen resolution changes) and UpdateOrder (for determining
what order to update the components in).
I think I'll just do it myself. The stuff that's already there isn't that
sophisticated, and the promise of lots of people building standard
components apparently didn't materialize because MS never released the
point-and-click "designer" part that would let you build games out of
components the way you build Windows apps out of widgets.
--
Darren New, San Diego CA, USA (PST)
Yes, we're traveling together,
but to different destinations.
Post a reply to this message
|
![](/i/fill.gif) |