Adding XNA components

Sep 28, 2010 at 3:23 PM

We're starting to work on getting network going for our game now and we tried adding the GamerServiceComponent by doing:

this = class inheriting from Application

 

this.XnaComponents.Add(new GamerServiceComponent(*THIS IS WHERE IT WANTS AN XNA GAME CLASS*);

 

The problem is that the class that inerhits from the XNA game class called XNAGameAppWrapper and it's very much unreachable from the Application class.

Coordinator
Sep 28, 2010 at 3:25 PM

Hi.

The Application class has an explicit cast to Game,

So:

Game game = (Game)application;

Cheers.

Sep 28, 2010 at 4:13 PM

Well for people looking for answers regarding this.

 

Override the property called protected internal virtual bool ApplicationRequiresGamerServices { get { return false; } } in the Application class in your class

that inherits from application.

 

Implement it as something like public override bool ApplicationRequiresGamerServices { get { return true; } }

 

This way further down the line GamerServices will be created in the lower xna-logic parts of XEN.

 

and onwards we go to network perfection! :)