Exceptions et gestion des fichiers : sauvegarder et charger un niveau
CHAPITRE 8
159
protected override void Update(GameTime gameTime)
{
if (Keyboard.GetState().IsKeyDown(Keys.A) && !Guide.IsVisible)
{
try
{
Guide.ShowGamerCard(PlayerIndex.One, SignedInGamer
➥.SignedInGamers[0]);
}
catch (Exception e)
{
Guide.BeginShowMessageBox(PlayerIndex.One, "Erreur", e.Message, new
➥string[] { "Ok" }, 0, MessageBoxIcon.Error, new
➥AsyncCallback(EndShowMessageBox), null);
}
}
base.Update(gameTime);
}
private void EndShowMessageBox(IAsyncResult result)
{
if (result.IsCompleted)
Guide.EndShowMessageBox(result);
}
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.Black);
base.Draw(gameTime);
}
}
Figure 8-8
À partir de ce panneau, le joueur peut administrer son compte
=Labat FM.book Page 159 Vendredi, 19. juin 2009 4:01 16
CHAPITRE 8
159
protected override void Update(GameTime gameTime)
{
if (Keyboard.GetState().IsKeyDown(Keys.A) && !Guide.IsVisible)
{
try
{
Guide.ShowGamerCard(PlayerIndex.One, SignedInGamer
➥.SignedInGamers[0]);
}
catch (Exception e)
{
Guide.BeginShowMessageBox(PlayerIndex.One, "Erreur", e.Message, new
➥string[] { "Ok" }, 0, MessageBoxIcon.Error, new
➥AsyncCallback(EndShowMessageBox), null);
}
}
base.Update(gameTime);
}
private void EndShowMessageBox(IAsyncResult result)
{
if (result.IsCompleted)
Guide.EndShowMessageBox(result);
}
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.Black);
base.Draw(gameTime);
}
}
Figure 8-8
À partir de ce panneau, le joueur peut administrer son compte
=Labat FM.book Page 159 Vendredi, 19. juin 2009 4:01 16
