예제 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (_serviceConnector.LogIn(LoginTextBox.Text, PasswordTextBox.Text))
            {
                LoginPanel.Visibility = Visibility.Collapsed;
                ChatPanel.Visibility  = Visibility.Collapsed;
                QuoridorService s1 = (QuoridorService)_serviceConnector;
                switch (LoginTextBox.Text)
                {
                case "Mateusz":
                    s1.MyId = 4;
                    break;

                case "Konrad":
                    s1.MyId = 2;
                    break;

                default:
                    s1.MyId = 0;
                    break;
                }
                Session.Instance.GameState = GameState.Logged;
                Session.Instance.User      = new Player()
                {
                    Id = s1.MyId
                };
                //ScreenManager.Instance.SwitchScreen(new GameBoard(_game.GraphicsDevice));
            }
        }