public CricketMatch(string id, string match_index, CricketSeries series,
                     CricketVenue venue, CricketScore score, CricketTeam team1, CricketTeam team2,
                     List <CricketPlayer> players, CricketToss toss,
                     string startTime, string expEndTime, string timeForNextDay,
                     string state, string dn, string matchDescription, string type, string liveCoverage,
                     string minorSeries, string stateTitle, string status, string winningTeamID,
                     string winningTeamMargin, List <string> mom, CricketOfficial official, List <CricketCommentary.Commentary> commentary)
 {
     ID               = id;
     MatchIndex       = match_index;
     Series           = series;
     Venue            = venue;
     StartTime        = startTime;
     ExpectedEndTime  = expEndTime;
     TimeForNextDay   = Convert.ToBoolean(timeForNextDay);
     State            = state;
     DN               = Convert.ToBoolean(dn);
     MatchDescription = matchDescription;
     Type             = type;
     LiveCoverage     = liveCoverage;
     MinorSeries      = Convert.ToBoolean(minorSeries);
     StateTitle       = stateTitle;
     Status           = status;
     Score            = score;
     Team1            = team1;
     Team2            = team2;
     Players          = players;
     Toss             = toss;
     WinningMargin    = winningTeamMargin;
     WinningTeamID    = winningTeamID;
     MOM              = mom;
     Official         = official;
     Commentaries     = commentary;
 }
Exemple #2
0
        private static CricketMatch CreateCricketMatchFromJson(KeyValuePair <string, object> match)
        {
            string id             = GetProperty(match, "id");
            string match_index    = GetProperty(match, "match_index");
            string start_time     = GetProperty(match, "start_time");
            string timeForNextDay = GetProperty(match, "timeForNextDay");
            string exp_end_time   = GetProperty(match, "exp_end_time");
            string state          = GetProperty(match, "state");
            string dn             = GetProperty(match, "dn");
            string match_desc     = GetProperty(match, "match_desc");
            string live_coverage  = GetProperty(match, "live_coverage");
            string state_title    = GetProperty(match, "state_title");
            string minor_series   = GetProperty(match, "minor_series");
            string status         = GetProperty(match, "status");
            string type           = GetProperty(match, "type");


            CricketSeries series  = CreateCricketSeries(match);
            CricketVenue  venue   = CreateCricketVenue(match);
            CricketScore  score   = CreateCricketScore(match);
            CricketTeam   team1   = CreateCricketTeam(match);
            CricketTeam   team2   = CreateCricketTeam(match, false);
            var           players = CreateCricketPlayers(match);
            var           toss    = CreateCricketToss(match);

            string winningID     = GetProperty(match, "winning_team_id");
            string winningMargin = GetProperty(match, "winningmargin");

            var mom        = CreateMOM(match);
            var official   = CreateCricketOfficial(match);
            var commentary = CricketCommentary.GetCommentary(id);

            return(new CricketMatch(id, match_index, series, venue, score, team1, team2, players, toss, start_time, exp_end_time,
                                    timeForNextDay, state, dn, match_desc, type, live_coverage,
                                    minor_series, state_title, status, winningID, winningMargin, mom, official, commentary));
        }