Esempio n. 1
0
        public manage_Rounds(Vehicle car, Maps map, Canvas raceingtrack, Starter start, Menue menue, double grid)
        {
            Car          = car;
            Map          = map;
            Raceingtrack = raceingtrack;
            Start        = start;
            Grid         = grid;
            Menue        = menue;


            System.Windows.Threading.DispatcherTimer refresh = new System.Windows.Threading.DispatcherTimer();
            refresh.Tick    += refresh_Tick;
            refresh.Interval = new TimeSpan(0, 0, 0, 0, 100);
            refresh.Start();

            Rounds = new TextBlock();

            if (Car.Compare_to_player == 1)
            {
                Canvas.SetLeft(Rounds, 0);
                Canvas.SetTop(Rounds, 0);

                Start.Rounds_player_1 = Rounds;
            }
            else if (Car.Compare_to_player == 2)
            {
                Canvas.SetLeft(Rounds, System.Windows.SystemParameters.MaximizedPrimaryScreenWidth - 200);
                Canvas.SetTop(Rounds, 0);
                Rounds.TextAlignment = System.Windows.TextAlignment.Right;

                Start.Rounds_player_2 = Rounds;
            }

            Raceingtrack.Children.Add(Rounds);

            Rounds.Text     = "Spieler " + Car.Compare_to_player.ToString() + "\n" + (Car.Round + 1).ToString() + "/" + Menue.Anz_rounds.ToString();
            Rounds.FontSize = 40;

            round_timer = new System.Diagnostics.Stopwatch();
        }