/// <summary>
        /// Débute la game.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                using (var svcClient = new GameServiceClient())
                {
                    GameView gView = new GameView();

                    UserSessionSingleton.Instance.CurrentGameToken =
                        svcClient.CreateGame(
                            UserSessionSingleton.Instance.UserToken.Value,
                            (Guid)tabCurrentRoom.DataContext);

                    gView.Closed      += ShowLobby;
                    gView.GameToken    = UserSessionSingleton.Instance.CurrentGameToken.Value;
                    gView.IsGameMaster = true;
                    gView.Show();

                    _changedRoom = false;
                    _joinedGame  = true;
                    Hide();
                }
            }
            catch
            {
                MessageBox.Show("Un problème s'est produit pour débuter la partie :^(");
            }
        }
Beispiel #2
0
 public void CreateGAme(Models.Game game)
 {
     using (GameServiceClient proxy = new GameServiceClient()) {
         GameServiceReference.Game serviceGame = GameModelConverter.ConvertFromClientGameToServiceGame(game);
         proxy.CreateGame(serviceGame);
     }
 }
        /// <summary>
        /// Débute la game.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                using (var svcClient = new GameServiceClient())
                {
                    GameView gView = new GameView();

                    UserSessionSingleton.Instance.CurrentGameToken =
                        svcClient.CreateGame(
                        UserSessionSingleton.Instance.UserToken.Value,
                        (Guid)tabCurrentRoom.DataContext);

                    gView.Closed += ShowLobby;
                    gView.GameToken = UserSessionSingleton.Instance.CurrentGameToken.Value;
                    gView.IsGameMaster = true;
                    gView.Show();

                    _changedRoom = false;
                    _joinedGame = true;
                    Hide();
                }
            }
            catch
            {
                MessageBox.Show("Un problème s'est produit pour débuter la partie :^(");
            }
        }