You can't. Important parts of their infrastructure are contained within the Game
class. (Also, GameComponent
's constructor takes a Game
.)
My advice (as always) is to not use GameComponent
. Like the Game
class itself, game components are a completely optional part of the framework. And often they're more trouble than they're worth.
You're better off just creating "normal" classes - however you like - and making a normal List
to contain them. If you need any other functionality that the game component infrastructure provides, that's pretty simple to implement too.
For reference, that functionality basically amounts to: a mechanism for adding/removing/re-ordering items while the list is being iterated (as simple as copying the list before iterating), sorting components, disabling/hiding components, and calling the various methods for you at the obvious times.
That being said, if you really want to use something identical to GameComponent
, you could take the relevant code from ExEn (or MonoGame, although I'm not sure what their code for this is like). The code in question is confined to the GameComponents directory and should be fairly independent. Unlike XNA itself, in ExEn the magic happens in the resuable GameComponentCollection
class instead of deep inside the Game
class.
(I looked into using XNA's own code for this - but it's not really possible to do in a way that isn't terrifying.)