Exemplo n.º 1
0
        private void btnLoad_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (!ofd.ShowDialog().Value)
            {
                return;
            }
            WarGamePage page = new WarGamePage();

            page.game.Load(ofd.FileName);
            NavigationService.Navigate(page);
        }
Exemplo n.º 2
0
        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            WarGamePage uri = new WarGamePage();

            string[] names =
            {
                txtP1Name.Text,
                txtP2Name.Text
            };
            bool[] comps =
            {
                cbxP1Computer.IsChecked.Value,
                cbxP2Computer.IsChecked.Value
            };
            uri.game.InitializePlayers(2, names, comps);
            uri.game.Start();
            uri.UpdateUI();
            NavigationService.Navigate(uri);
        }