Пример #1
0
 private void ButtonSinglePlayer_Click(object sender, RoutedEventArgs e)
 {
     var placement = this.GetPlacement();
     GameWindow gameWindow = new GameWindow(this._loginData, placement, GameMode.Singleplayer);
     gameWindow.Show();
     this.Close();
 }
        public LoadingScreen(GameOptions options)
        {
            InitializeComponent();

            Window gameWindow = new GameWindow(options);
            gameWindow.Show();
            this.Hide();
        }
Пример #3
0
 private void PlayGame()
 {
     if(SelectedQuiz.VragenLijst != null){
         if (SelectedQuiz.VragenLijst.Count > 1)
         {
             GetVraag();
             addGameWindow = new GameWindow();
             addGameWindow.Show();
         }
         else
         {
             MessageBox.Show("Quiz moet minstens 2 vragen bevatten!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
 }
Пример #4
0
        private void LaunchGame( Object filler = null )
        {
            // ROBIN: I previously attempted to pass the Client object to the GameWindow's constructor. As a result (for an unknown reason),
            // the Client's callback messages were not registering. Therefore, each client is disconnected from the server before launching the game.
            // A new Client object is created and connected to the server when the GameWindow is constructed.
            Client.Disconnect("Bye");
            Client.UnregisterReceivedCallback(this.Callback);
            this.Disconnected = true;

            GameWindow gameWindow = new GameWindow(this.Player.Name, this.ServerIP, this.Turn);
            gameWindow.Show();
            this.Close();
        }