示例#1
0
        private void Pridej_baracek(object sender, RoutedEventArgs e)
        {
            Button butt = sender as Button;
            string ae   = butt.Name.Substring(6, 1);
            string be;

            if (butt.Name.Length == 8)
            {
                be = butt.Name.Substring(7, 1);
            }
            else
            {
                be = butt.Name.Substring(7, 2);
            }
            int a = int.Parse(ae);
            int b = int.Parse(be);

            if (staveni_bool)
            {
                if (butt.BorderBrush == Brushes.Green)
                {
                    Podokno.Navigate(new vyber(Podokno, b, a, "Budova"));
                }
                else
                {
                    Podokno.Navigate(new potvrzeni(Podokno, a, b, "Stavba"));
                }
                OdStaveni();
                podokno = Podokno;
            }
            else
            {
                int ad = 0;
                int bd = 0;
                int aa = 0;
                int bb = 0;
                foreach (List <Budova> budovas in Budovy)
                {
                    bd = 0;
                    foreach (Budova budovan in budovas)
                    {
                        if (budovan.X_radek == b && budovan.Y_sloupec == a)
                        {
                            aa = ad;
                            bb = bd;
                        }
                        bd++;
                    }
                    ad++;
                }
                if (Budovy[aa][bb] is Domov || Budovy[aa][bb] is Dilna)
                {
                    Podokno.Navigate(new Menu_budovy(Podokno, aa, bb));
                }

                //podokno = Podokno;
            }
        }
示例#2
0
        private void Tezeni_Click(object sender, RoutedEventArgs e)
        {
            Button butt = sender as Button;

            if (butt.Name == "drevorubec")
            {
                Podokno.Navigate(new Menu_budovy(Podokno, -1, -1));
            }
            else if (butt.Name == "kamenolom")
            {
                Podokno.Navigate(new Menu_budovy(Podokno, -2, -2));
            }
            else
            {
                Podokno.Navigate(new Menu_budovy(Podokno, -3, -3));
            }
        }
示例#3
0
 private void Inventar_click(object sender, RoutedEventArgs e)
 {
     Podokno.Navigate(new Inventory(Podokno));
 }
示例#4
0
 private void Dalsi_kolo_Click(object sender, RoutedEventArgs e)
 {
     Podokno.Navigate(new potvrzeni(podokno, 0, 0, "Kolo"));
 }
示例#5
0
 private void Nastaveni_Click(object sender, RoutedEventArgs e)
 {
     Podokno.Navigate(new NastaveniMenu(Podokno));
     podokno = Podokno;
 }