Exceptions et gestion des fichiers : sauvegarder et charger un niveau
CHAPITRE 8
161
Dans la barre de titre de la fenêtre, vous pouvez lire :
Maintenant, modifiez la classe de manière à ce que la propriété SimulateTrialMode soit
définie à true.
Simuler une version d’essai
public class ChapitreHuit : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
public ChapitreHuit()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
this.Components.Add(new GamerServicesComponent(this));
}
protected override void Initialize()
{
base.Initialize();
Guide.SimulateTrialMode = true;
}
protected override void Update(GameTime gameTime)
{
if (Guide.IsTrialMode)
Window.Title = "Trial Mode";
else
Window.Title = "Full Mode";
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.Black);
base.Draw(gameTime);
}
}
Vous pouvez à présent lire :
Full Mode
Trial Mode
=Labat FM.book Page 161 Vendredi, 19. juin 2009 4:01 16
CHAPITRE 8
161
Dans la barre de titre de la fenêtre, vous pouvez lire :
Maintenant, modifiez la classe de manière à ce que la propriété SimulateTrialMode soit
définie à true.
Simuler une version d’essai
public class ChapitreHuit : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
public ChapitreHuit()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
this.Components.Add(new GamerServicesComponent(this));
}
protected override void Initialize()
{
base.Initialize();
Guide.SimulateTrialMode = true;
}
protected override void Update(GameTime gameTime)
{
if (Guide.IsTrialMode)
Window.Title = "Trial Mode";
else
Window.Title = "Full Mode";
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.Black);
base.Draw(gameTime);
}
}
Vous pouvez à présent lire :
Full Mode
Trial Mode
=Labat FM.book Page 161 Vendredi, 19. juin 2009 4:01 16
