Пример #1
0
        public DorfWindow(String _username, int session)
        {
            this.Session = session;
            InitializeComponent();
            Timer = new EventTimer();

            try
            {
                Spieler spieler = WebServiceCom.newInstance().getSpielerDetial(_username);

                dorf = WebServiceCom.newInstance().getDorfDetial(spieler.doerfer[0], Session);

                GridDoerfer.ItemsSource = spieler.doerfer;

                fillWithDorfData(dorf);
                InitializeComponent();
                
                //Fill Doerfer Grid!!!
                spieler.doerfer = getDoerferNames();

                GridDoerfer.SelectedIndex = 0;
                fillWithDorfData((Dorf)GridDoerfer.SelectedItem);

                Canvas canvasBackgroundMap = new Canvas();

                   
                BitmapImage carBitmap = new BitmapImage(new Uri("pack://application:,,,/DWR-Resources/dorf_background.jpg"));

                rectBev.Fill = Brushes.Transparent;
                ListJobs.Background = Brushes.Transparent;
                GridGebäude.Background = Brushes.Transparent;
                GridDoerfer.Background = Brushes.Transparent;
                Image i = new Image();
                i.Source = carBitmap;
                canvasBackgroundMap.Children.Add(i);

                pnlMap.Content = canvasBackgroundMap;
            }
            catch (Exception ex)
            {
               //MessageBox.Show("Error: " + ex.Message);
            }
        }
Пример #2
0
        private void fillWithDorfData(Dorf dorf)
        {
            lblDorfName.Content = dorf.name;

            lblAmountHolz.Content = dorf.rohstoffe.holz;
            lblAmountStein.Content = dorf.rohstoffe.stein;
            lblAmountLehm.Content = dorf.rohstoffe.lehm;

            lblAmountFighters.Content = dorf.truppen.schwert;
            lblAmountRiders.Content = dorf.truppen.reiter;
            lblAmountLancer.Content = dorf.truppen.lanze;
            lblAmountArcher.Content = dorf.truppen.bogen;

            fillGridGebaeude();

            Canvas Gebäude = addPictureToBuilding();
            pnlMap.Content = Gebäude;
            pnlMap.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden;

        }
Пример #3
0
 public void UpdateDorf()
 {
     clearDorf();
     dorf = WebServiceCom.newInstance().getDorfDetial(dorf.id, Session);
     fillWithDorfData(dorf);
 }
Пример #4
0
 public void addDorfToSpieler(Dorf _dorf, Spieler _spieler) { 
     
 
 }