예제 #1
0
        public static int[] GetTrefferquoteLeg(Leg l, int feldMulti, int finish, int wurfEigenschaft = 0)
        {
            int getroffen = 0;
            int versucht  = 0;

            for (int i = 0; i < l.GetDurchgänge().Count; i++)
            {
                if ((finish == 0) || (!l.GetDurchgänge()[i].IsFinishBereich() && finish == 1) || (l.GetDurchgänge()[i].IsFinishBereich() && finish == 2))
                {
                    getroffen += GetTrefferquoteDurchgang(l.GetDurchgänge()[i], feldMulti, wurfEigenschaft)[0];
                    versucht  += GetTrefferquoteDurchgang(l.GetDurchgänge()[i], feldMulti, wurfEigenschaft)[1];
                }
            }
            return(new int[] { getroffen, versucht });
        }
예제 #2
0
        private String Show_Leg(Leg l)
        {
            String           s           = "";
            List <Durchgang> durchgaenge = l.GetDurchgänge();

            for (int i = 0; i < durchgaenge.Count; i++)
            {
                s += "\n\t\tDurchgang " + (i + 1);
                Wurf[] wuerfe = durchgaenge.ElementAt(i).GetWürfe();
                for (int j = 0; j < durchgaenge.ElementAt(i).GetAnzahlWürfe(); j++)
                {
                    s += "\n\t\t\t" + wuerfe[j].GetMulti() + "x" + wuerfe[j].GetWert();
                }
            }
            return(s);
        }
예제 #3
0
        private void cB_legAuswahl_SelectedIndexChanged(object sender, EventArgs e)
        {
            rtbInfos.Text = "";
            if (cB_legAuswahl.SelectedIndex == -1)
            {
                return;
            }
            if (cB_legAuswahl.SelectedIndex == 0 && cB_setAuswahl.SelectedIndex > 0)
            {
                rtbInfos.Text += Show_Set(set);
                lblQuoteAuswahlInsWertIns.Text    = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 0, 0)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 0, 0)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlInsWertEinzel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 1, 0)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 1, 0)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlInsWertDoppel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 2, 0)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 2, 0)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlInsWertTriple.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 3, 0)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 3, 0)[1]))) * 100, 2) + "%";

                lblQuoteAuswahlNoFinishWertIns.Text    = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 0, 1)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 0, 1)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlNoFinishWertEinzel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 1, 1)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 1, 1)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlNoFinishWertDoppel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 2, 1)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 2, 1)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlNoFinishWertTriple.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 3, 1)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 3, 1)[1]))) * 100, 2) + "%";

                lblQuoteAuswahlFinishWertIns.Text    = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 0, 2)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 0, 2)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlFinishWertEinzel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 1, 2)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 1, 2)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlFinishWertDoppel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 2, 2)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 2, 2)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlFinishWertTriple.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteSet(set, 3, 2)[0])) / ((double)(Statistik.GetTrefferquoteSet(set, 3, 2)[1]))) * 100, 2) + "%";
            }
            if (cB_legAuswahl.SelectedIndex > 0)
            {
                leg            = set.GetLegs().ElementAt(cB_legAuswahl.SelectedIndex - 1);
                rtbInfos.Text += Show_Leg(leg);
                lblQuoteAuswahlInsWertIns.Text    = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 0, 0)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 0, 0)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlInsWertEinzel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 1, 0)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 1, 0)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlInsWertDoppel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 2, 0)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 2, 0)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlInsWertTriple.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 3, 0)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 3, 0)[1]))) * 100, 2) + "%";

                lblQuoteAuswahlNoFinishWertIns.Text    = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 0, 1)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 0, 1)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlNoFinishWertEinzel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 1, 1)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 1, 1)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlNoFinishWertDoppel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 2, 1)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 2, 1)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlNoFinishWertTriple.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 3, 1)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 3, 1)[1]))) * 100, 2) + "%";

                lblQuoteAuswahlFinishWertIns.Text    = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 0, 2)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 0, 2)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlFinishWertEinzel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 1, 2)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 1, 2)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlFinishWertDoppel.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 2, 2)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 2, 2)[1]))) * 100, 2) + "%";
                lblQuoteAuswahlFinishWertTriple.Text = "" + Statistik.RoundDouble((((double)(Statistik.GetTrefferquoteLeg(leg, 3, 2)[0])) / ((double)(Statistik.GetTrefferquoteLeg(leg, 3, 2)[1]))) * 100, 2) + "%";
            }
        }
예제 #4
0
        public static void InsertLeg(Leg leg, Set set)
        {
            string query = "INSERT INTO leg (`id_leg`, `id_set`, `legNummer`, `rest`, `finish`) VALUES ('" + leg.GetId() + "', '" + set.GetId() + "', '" + leg.GetLegNummer() + "', '" + leg.GetRest() + "', '" + leg.GetFinish() + "')";

            //open connection
            if (OpenConnection() == true)
            {
                try
                {
                    //create command and assign the query and connection from the constructor
                    MySqlCommand cmd = new MySqlCommand(query, connection);

                    //Execute command
                    cmd.ExecuteNonQuery();
                }
                catch (Exception e)
                {
                    Console.WriteLine("Leg:" + e.Message);
                    Console.ReadLine();
                }
                //close connection
                CloseConnection();
            }
        }
예제 #5
0
 public static double AvgW_Leg_NotFinish(Leg l)
 {
     return(AvgD_Leg_NotFinish(l) / 3);
 }
예제 #6
0
 public static double AvgD_Leg_NotFinish(Leg l)
 {
     return(SummeLegDurchgängeNotFinish(l) / AnzahlLegDurchgängeNotFinish(l));
 }
예제 #7
0
 public static int Get_Finish(Leg l)
 {
     return(l.GetFinish());
 }