POV-Ray : Newsgroups : povray.off-topic : Generics annoyance : Re: Generics annoyance Server Time
4 Sep 2024 13:17:01 EDT (-0400)
  Re: Generics annoyance  
From: Darren New
Date: 13 Apr 2010 12:31:55
Message: <4bc49c7b$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.