コード例 #1
0
        private void NewGame_Click(object sender, RoutedEventArgs e)
        {
            FormNew fn = new FormNew();

            fn.Owner = this;

            if (fn.ShowDialog() == true)
            {
                // Convention for the whole application:
                // player1 always stores the first player
                player1 = new Player(fn.Name1, fn.IsHuman1, true);
                player2 = new Player(fn.Name2, fn.IsHuman2, false);

                DIM = fn.DIM;
                InitialiseBoards();
                gameStats = new GameStats();

                // Update GUI
                player1name.Text = fn.Name1;
                player2name.Text = fn.Name2;

                player1stats.Text = "0 0 0";
                player2stats.Text = "0 0 0";

                footerlabel1.Visibility = Visibility.Visible;
                footerlabel2.Visibility = Visibility.Visible;

                Start();
            }
        }
コード例 #2
0
		private void NewGame_Click(object sender, RoutedEventArgs e) {

			FormNew fn = new FormNew();
			fn.Owner   = this;

			if (fn.ShowDialog() == true) {
				// Convention for the whole application: 
				// player1 always stores the first player
				player1 = new Player(fn.Name1, fn.IsHuman1, true);
				player2 = new Player(fn.Name2, fn.IsHuman2, false);

				DIM = fn.DIM;
				InitialiseBoards();
				gameStats = new GameStats();

				// Update GUI
				player1name.Text = fn.Name1;
				player2name.Text = fn.Name2;

				player1stats.Text = "0 0 0";
				player2stats.Text = "0 0 0";

				footerlabel1.Visibility = Visibility.Visible;
				footerlabel2.Visibility = Visibility.Visible;

				Start();
			}
		}