Ejemplo n.º 1
0
        private static void AddMatchToPlayer(ref ButlerPlayer player, TablesButlerData tData, int pos)
        {
            if (NS(pos) && openRoom(pos)) //NS open
            {
                player.imps.Add(tData.impsOR);
                player.opponentsTeam.Add(tData.TeamAway);
                player.opponentsPlayer.Add(tData.players[5] + " " + tData.players[6]);


                player.impyzrozdaniami.Add(tData.impyOR);
            }

            if (NS(pos) && !openRoom(pos)) //NS closed
            {
                player.imps.Add(tData.impsCR);
                player.opponentsTeam.Add(tData.TeamHome);
                player.opponentsPlayer.Add(tData.players[1] + " " + tData.players[2]);



                player.impyzrozdaniami.Add(tData.impyCR);
            }

            if (!NS(pos) && openRoom(pos)) //EW Open
            {
                player.imps.Add(-tData.impsOR);
                player.opponentsTeam.Add(tData.TeamHome);
                player.opponentsPlayer.Add(tData.players[0] + " " + tData.players[3]);


                int[] tmp = tData.impyOR;
                for (int i = 0; i < tData.impyOR.Count(); i++)
                {
                    tmp[i] = -tmp[i];
                }

                player.impyzrozdaniami.Add(tmp);
            }

            if (!NS(pos) && !openRoom(pos)) //EW Closed
            {
                player.imps.Add(-tData.impsCR);
                player.opponentsTeam.Add(tData.TeamAway);
                player.opponentsPlayer.Add(tData.players[4] + " " + tData.players[7]);


                int[] tmp = tData.impyCR;
                for (int i = 0; i < tData.impyCR.Count(); i++)
                {
                    tmp[i] = -tmp[i];
                }

                player.impyzrozdaniami.Add(tmp);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Funkcja wczytuje dane z naglowka oraz z tabeli z wynikami na podstawie html do struktury programu TablesButlerData
        /// </summary>
        /// <param name="html">Html z protokolem z meczu</param>
        /// <returns>Dane w strukturze programu TablesButleraData</returns>
        private TablesButlerData ReadDataScoresWithTableInfo(string html)
        {
            TableHeader tableheader = GetTableInfo(html);

            List <int>[] scores = GetScores(html);

            TablesButlerData tableData = new TablesButlerData();

            tableData.players  = tableheader.surnames;
            tableData.TeamHome = tableheader.homeTeam;
            tableData.TeamAway = tableheader.awayTeam;

            tableData.scoresOR = scores[0];
            tableData.scoresCR = scores[1];

            tableData.id = (tournament_id * 10000 + round_id * 100);

            return(tableData);
        }
Ejemplo n.º 3
0
        private static ButlerPlayer AddNewPlayer(TablesButlerData tData, int pos)
        {
            ButlerPlayer player = new ButlerPlayer();

            player.opponentsPlayer = new List <string>();
            player.opponentsTeam   = new List <string>();
            player.imps            = new List <int>();
            player.name            = tData.players[pos];
            player.impyzrozdaniami = new List <int[]>();

            if (NS(pos) && openRoom(pos)) //NS open
            {
                player.imps.Add(tData.impsOR);
                player.opponentsTeam.Add(tData.TeamAway);
                player.opponentsPlayer.Add(tData.players[5] + " " + tData.players[6]);
                player.team = tData.TeamHome;

                player.impyzrozdaniami.Add(tData.impyOR);
            }

            if (NS(pos) && !openRoom(pos)) //NS closed
            {
                player.imps.Add(tData.impsCR);
                player.opponentsTeam.Add(tData.TeamHome);
                player.opponentsPlayer.Add(tData.players[1] + " " + tData.players[2]);
                player.team = tData.TeamAway;

                player.impyzrozdaniami.Add(tData.impyCR);
            }

            if (!NS(pos) && openRoom(pos)) //EW Open
            {
                player.imps.Add(-tData.impsOR);
                player.opponentsTeam.Add(tData.TeamHome);
                player.opponentsPlayer.Add(tData.players[0] + " " + tData.players[3]);
                player.team = tData.TeamAway;

                int[] tmp = tData.impyOR;
                for (int i = 0; i < tData.impyOR.Count(); i++)
                {
                    tmp[i] = -tmp[i];
                }

                player.impyzrozdaniami.Add(tmp);
            }

            if (!NS(pos) && !openRoom(pos)) //EW Closed
            {
                player.imps.Add(-tData.impsCR);
                player.opponentsTeam.Add(tData.TeamAway);
                player.opponentsPlayer.Add(tData.players[4] + " " + tData.players[7]);
                player.team = tData.TeamHome;

                int[] tmp = tData.impyCR;
                for (int i = 0; i < tData.impyCR.Count(); i++)
                {
                    tmp[i] = -tmp[i];
                }

                player.impyzrozdaniami.Add(tmp);
            }

            return(player);
        }