Example #1
0
        private void btn_join_Click(object sender, RoutedEventArgs e)
        {
            IMultiPlayerViewModel vm = this.multi_vm.JoinGame();

            //while(vm.Status == 0) { }

            if (vm == null || vm.Status == 2)
            {
                MessageBox.Show("Could not join game!");
                return;
            }

            Window next = new MultiPlayerGame(vm, this.parent);

            next.Show();
            this.parent = null;
            this.Close();
        }
Example #2
0
        private void btn_startgame_Click(object sender, RoutedEventArgs e)
        {
            this.multi_vm.MazeName    = this.game_properties.txt_gamename.Text;
            this.multi_vm.MazeRowsStr = this.game_properties.txt_rows.Text;
            this.multi_vm.MazeColsStr = this.game_properties.txt_cols.Text;

            IMultiPlayerViewModel vm = this.multi_vm.StartGame();

            if (vm == null)
            {
                MessageBox.Show("Invalid input!");
                return;
            }

            Window next = new MultiPlayerGame(vm, this.parent);

            next.Show();
            this.parent = null;
            this.Close();
        }