Skip to content

Commit

Permalink
minor: merge conflicts resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
plaberge committed Sep 6, 2024
2 parents fa6b0e2 + a6ab934 commit 641d598
Show file tree
Hide file tree
Showing 33 changed files with 2,394 additions and 1,989 deletions.
12 changes: 10 additions & 2 deletions NHLStats/NHLStats.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29001.49
# Visual Studio Version 17
VisualStudioVersion = 17.7.34302.85
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NHLStats", "NHLStats\NHLStats.csproj", "{DF25B9DB-6B80-4865-899F-748CB5548528}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestHarness", "TestHarness\TestHarness.csproj", "{BD37F352-D39B-48BA-A3B2-671B77E854B3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -18,6 +20,12 @@ Global
{DF25B9DB-6B80-4865-899F-748CB5548528}.Packaged|Any CPU.Build.0 = Debug|Any CPU
{DF25B9DB-6B80-4865-899F-748CB5548528}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF25B9DB-6B80-4865-899F-748CB5548528}.Release|Any CPU.Build.0 = Release|Any CPU
{BD37F352-D39B-48BA-A3B2-671B77E854B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD37F352-D39B-48BA-A3B2-671B77E854B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD37F352-D39B-48BA-A3B2-671B77E854B3}.Packaged|Any CPU.ActiveCfg = Debug|Any CPU
{BD37F352-D39B-48BA-A3B2-671B77E854B3}.Packaged|Any CPU.Build.0 = Debug|Any CPU
{BD37F352-D39B-48BA-A3B2-671B77E854B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD37F352-D39B-48BA-A3B2-671B77E854B3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
26 changes: 5 additions & 21 deletions NHLStats/NHLStats/BoxScore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class BoxScore
public string homeTeamId { get; set; } // ID of the Home Team
public TeamGameStats homeTeamStats { get; set; } // Stats from the home team
public TeamGameStats awayTeamStats { get; set; } // Stats from the away team
public List<Person> officials { get; set; } // The list of officials for the game


public JObject boxScoreJson { get; set; } // The raw JSON for the box score data.

Expand All @@ -23,29 +23,13 @@ public BoxScore(string homeTeamID, string awayTeamID, JObject json)
//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);
homeTeamStats = new TeamGameStats(boxScoreJson, Convert.ToInt32(homeTeamId));
awayTeamStats = new TeamGameStats(boxScoreJson, Convert.ToInt32(awayTeamId));

}


}

// 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);

}

}
}
17 changes: 1 addition & 16 deletions NHLStats/NHLStats/Division.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,7 @@ public Division(int theDivisionId)
}
}

public static List<Division> GetAllDivisions()
{
var json = DataAccessLayer.ExecuteAPICall(NHLAPIServiceURLs.divisions);
var divisionArray = JArray.Parse(json.SelectToken("divisions").ToString());

List<Division> listOfDivisions = new List<Division>();
Division tempDivision;

foreach (var aDivision in divisionArray)
{
tempDivision = new Division(Convert.ToInt32(aDivision.SelectToken("id")));
listOfDivisions.Add(tempDivision);
}

return listOfDivisions;
}


}
}
Loading

0 comments on commit 641d598

Please sign in to comment.