Exemplo n.º 1
0
 private void btn_login_Click(object sender, EventArgs e)
 {
     if (CheckLogin())
     {
         Program.spieler = Dart.GetSpieler(tBx_username.Text.ToLower());
         Program.frmStartingScreen.Hide();
         Program.frmMainMenu.Show();
     }
     else
     {
         lbl_falseUser.Visible = true;
         tBx_username.Clear();
         tBx_passwort.Clear();
     }
 }
Exemplo n.º 2
0
        public void Reset()
        {
            cB_setAuswahl.Visible = false;
            cB_legAuswahl.Visible = false;
            cB_spielAuswahl.Items.Clear();
            cB_spielAuswahl.SelectedIndex = -1;
            cB_spielAuswahl.Text          = "Spiel auswählen";
            List <Spiel> spiele = Dart.SearchSpielePlayedBy(Program.spieler);

            for (int i = spiele.Count - 1; i >= 0; i--)
            {
                cB_spielAuswahl.Items.Add(spiele.ElementAt(i).GetDatum());
            }
            rtbInfos.Text = "";
        }
Exemplo n.º 3
0
 private static void ShowSpiel(Spiel sp, Spieler s)
 {
     Console.Clear();
     try
     {
         Console.WriteLine("Spiel vom: " + sp.GetDatum().ToString("g"));
         Dart.WriteChar('~', 30);
         Console.WriteLine("Gesamt - Avg: " + RoundDouble(AvgD_Spiel_NotFinish(sp, s), 2) + " -> W: " + RoundDouble(AvgW_Spiel_NotFinish(sp, s), 2) + "| D: " + RoundDouble(100 * GetDoubleFinishQuoteSpielSpieler(sp, s), 2) + "%");
         List <Set> sets = sp.GetSetsPlayer(s);
         for (int set = 0; set < sets.Count(); set++)
         {
             Dart.WriteChar(' ', 2, false);
             Console.WriteLine("Set " + (set + 1) + " - Avg: " + RoundDouble(AvgD_Set_NotFinish(sets.ElementAt(set)), 2) + " -> W: " + RoundDouble(AvgW_Set_NotFinish(sets.ElementAt(set)), 2) + "| D: " + RoundDouble(100 * GetDoubleFinishQuoteSet(sets.ElementAt(set)), 2) + "%");
             List <Leg> legs = sets.ElementAt(set).GetLegs();
             for (int leg = 0; leg < legs.Count(); leg++)
             {
                 Dart.WriteChar(' ', 4, false);
                 Console.WriteLine("Leg " + (leg + 1) + " - Avg: " + RoundDouble(AvgD_Leg_NotFinish(legs.ElementAt(leg)), 2) + " -> W: " + RoundDouble(AvgW_Leg_NotFinish(legs.ElementAt(leg)), 2) + "| D: " + RoundDouble(100 * GetDoubleFinishQuoteLeg(legs.ElementAt(leg)), 2) + "%");
                 List <Durchgang> durchgänge = legs.ElementAt(leg).GetDurchgänge();
                 for (int ds = 0; ds < durchgänge.Count(); ds++)
                 {
                     Dart.WriteChar(' ', 6, false);
                     Console.WriteLine("Aufnahme " + (ds + 1));
                     Wurf[] würfe = durchgänge.ElementAt(ds).GetWürfe();
                     for (int w = 0; w < durchgänge.ElementAt(ds).GetAnzahlWürfe(); w++)
                     {
                         Dart.WriteChar(' ', 8, false);
                         Console.WriteLine("Wurf " + (w + 1) + ": " + würfe[w].GetMulti() + "x" + würfe[w].GetWert());
                     }
                 }
                 Dart.WriteChar(' ', 4, false);
                 Console.WriteLine("Finish: " + legs.ElementAt(leg).GetFinish());
             }
             Dart.WriteChar(' ', 2, false);
             Console.WriteLine("Highest Finish: " + Highest_Finish_Set(sets.ElementAt(set)));
             Dart.WriteChar(' ', 2, false);
             Console.WriteLine("Avg Finish: " + RoundDouble(Average_Finish_Set(sets.ElementAt(set)), 2));
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         Dart.Confirm_Dialog();
     }
 }
Exemplo n.º 4
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     frmLoad = new LoadView();
     frmLoad.Show();
     Dart.Init();
     frmMainMenu       = new MainMenu();
     frmMainView       = new Spielerauflistung();
     frmStartingScreen = new StartingScreen();
     frmGameOptions    = new SpielEinstellungen();
     frmSpielView      = new SpielView();
     frmStatistikView  = new StatistikView();
     frmWurfView       = new WurfzielView();
     frmLoad.Hide();
     frmStartingScreen.Show();
     Application.Run();
 }
Exemplo n.º 5
0
        private void btn_OK_Click(object sender, EventArgs e)
        {
            if (IsValid())
            {
                tBx_username.BackColor = Color.White;
                tBx_eMail.BackColor    = Color.White;

                //Passwort Wdh Überprüfung steht noch aus
                //String passwdHash = Dart.HashString(tBx_Passwort.Text);
                Dart.AddSpieler(tBx_username.Text.ToLower(), Dart.GetAgeFromDate(DateTime.Parse(tBx_Geburtsdatum.Text)), tBx_eMail.Text, tBx_FirstName.Text, tBx_LastName.Text, DateTime.Parse(tBx_Geburtsdatum.Text), tBx_Passwort.Text);

                Dart.SaveSpielerToDB();

                MessageBox.Show("Spieler erfolgreich erstellt.");

                this.Close();
            }
        }
Exemplo n.º 6
0
        private void cB_spielAuswahl_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cB_spielAuswahl.SelectedIndex == -1)
            {
                return;
            }
            spiel = Dart.SearchSpielePlayedBy(Program.spieler).ElementAt((Dart.SearchSpielePlayedBy(Program.spieler).Count - 1) - cB_spielAuswahl.SelectedIndex);
            cB_setAuswahl.Visible       = true;
            cB_setAuswahl.SelectedIndex = -1;
            cB_setAuswahl.Text          = "Set auswählen";
            cB_setAuswahl.Items.Clear();
            sets = spiel.GetSetsPlayer(Program.spieler);
            cB_setAuswahl.Items.Add("Alle");

            for (int i = 1; i <= sets.Count; i++)
            {
                cB_setAuswahl.Items.Add("Set " + i);
            }
            cB_legAuswahl.Visible = false;
        }
Exemplo n.º 7
0
 public bool HasPlayed(String name)
 {
     return(HasPlayed(Dart.GetSpieler(name)));
 }
Exemplo n.º 8
0
 public static double SummeGesamtDurchgängeNotFinish(String spieler)
 {
     return(SummeGesamtDurchgängeNotFinish(Dart.GetSpieler(spieler)));
 }
Exemplo n.º 9
0
 public static int Highest_Finish_Spiel(Spiel s, String spieler)
 {
     return(Highest_Finish_Spiel(s, Dart.GetSpieler(spieler)));
 }
Exemplo n.º 10
0
 public static double AnzahlFinishGesamt(String s)
 {
     return(AnzahlFinishGesamt(Dart.GetSpieler(s)));
 }
Exemplo n.º 11
0
 public static double SummeFinishGesamt(String s)
 {
     return(SummeFinishGesamt(Dart.GetSpieler(s)));
 }
Exemplo n.º 12
0
 public static double AnzahlFinishSpiel(Spiel sp, String s)
 {
     return(AnzahlFinishSpiel(sp, Dart.GetSpieler(s)));
 }
Exemplo n.º 13
0
 public static double SummeFinishSpiel(Spiel sp, String s)
 {
     return(SummeFinishSpiel(sp, Dart.GetSpieler(s)));
 }
Exemplo n.º 14
0
 public static double Average_Finish_Gesamt(String s)
 {
     return(Average_Finish_Gesamt(Dart.GetSpieler(s)));
 }
Exemplo n.º 15
0
 public static double Average_Finish_Spiel(Spiel sp, String s)
 {
     return(Average_Finish_Spiel(sp, Dart.GetSpieler(s)));
 }
Exemplo n.º 16
0
 public int GetAlter()
 {
     return(Dart.GetAgeFromDate(geburtstag));
 }
Exemplo n.º 17
0
 public static double SummeSpielDurchgängeNotFinish(Spiel s, String name)
 {
     return(SummeSpielDurchgängeNotFinish(s, Dart.GetSpieler(name)));
 }
Exemplo n.º 18
0
 public static double AnzahlGesamtDurchgängeNotFinish(String s)
 {
     return(AnzahlGesamtDurchgängeNotFinish(Dart.GetSpieler(s)));
 }
Exemplo n.º 19
0
 public static Spiel GetLastGame(Spieler s)
 {
     return(Dart.SearchSpielePlayedBy(s).Last());
 }