Esempio n. 1
0
        // Constructor with featureFlag denotes that not all data on the BoxScore downward is being populated (think "BoxScore Light")
        public BoxScore(string homeTeamID, string awayTeamID, JObject json, int featureFlag)
        {
            awayTeamId = awayTeamID;
            homeTeamId = homeTeamID;

            awayTeamStats = new TeamGameStats(json.SelectToken("teams.away").ToObject <JObject>(), Convert.ToInt32(awayTeamId), featureFlag);
            homeTeamStats = new TeamGameStats(json.SelectToken("teams.home").ToObject <JObject>(), Convert.ToInt32(homeTeamId), featureFlag);
        }
Esempio n. 2
0
        }                                         // The raw JSON for the box score data.

        public BoxScore(string homeTeamID, string awayTeamID, JObject json)
        {
            awayTeamId = awayTeamID;
            homeTeamId = homeTeamID;

            //Populate the raw JSON data to the boxScoreJson property
            boxScoreJson = json;

            awayTeamStats = new TeamGameStats(json.SelectToken("teams.away").ToObject <JObject>(), Convert.ToInt32(awayTeamId));
            homeTeamStats = new TeamGameStats(json.SelectToken("teams.home").ToObject <JObject>(), Convert.ToInt32(homeTeamId));

            officials = new List <Person>();
            Person tempReferee;

            foreach (var referee in JArray.Parse(json.SelectToken("officials").ToString()))
            {
                tempReferee = new Person(referee.ToObject <JObject>());
                officials.Add(tempReferee);
            }
        }