-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add draft ranking methods and update team status handling
Enhanced the codebase with several key updates: - Added new namespaces across multiple files for better organization. - Introduced `TeamActive` attribute in `TeamEnum` to indicate team status. - Removed the `Ranks` class and its properties. - Updated `GameCenterPlayByPlay` property documentation and default value. - Refactored test methods in `GameTests.cs` and `PlayerTests.cs` for improved validation. - Added `GetPlayerDraftRankingByYearAsync` method in `NhlApi.cs`, `INhlPlayerApi.cs`, and `NhlPlayerApi.cs` to fetch draft rankings. - Excluded `ArizonaCoyotes` from NHL teams for seasons 2024-2025 or later in `NhlStatisticsApi.cs`. - Introduced new classes to represent NHL draft player rankings and categories.
- Loading branch information
1 parent
965bfe5
commit 5e8c748
Showing
13 changed files
with
368 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
|
||
namespace Nhl.Api.Common.Attributes; | ||
|
||
/// <summary> | ||
/// An enumeration to specifically mark NHL teams active or inactive | ||
/// </summary> | ||
/// <remarks> | ||
/// The constructor | ||
/// </remarks> | ||
/// <param name="isActive">Whether an NHL team is active in the leauge</param> | ||
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)] | ||
public class TeamActiveAttribute(bool isActive) : Attribute | ||
{ | ||
/// <summary> | ||
/// Determines if the NHL team is currently active | ||
/// </summary> | ||
public bool IsActive { get; } = isActive; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Runtime.Serialization; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
| ||
|
||
namespace Nhl.Api.Models.Draft; | ||
|
||
/// <summary> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace Nhl.Api.Models.Draft; | ||
|
||
/// <summary> | ||
/// The NHL draft player category | ||
/// </summary> | ||
public class PlayerDraftCategory | ||
{ | ||
/// <summary> | ||
/// The ID of the player draft category | ||
/// </summary> | ||
[JsonProperty("id")] | ||
public int? Id { get; set; } | ||
|
||
/// <summary> | ||
/// The name of the player draft category | ||
/// </summary> | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// The consumer key of the player draft category | ||
/// </summary> | ||
[JsonProperty("consumerKey")] | ||
public string ConsumerKey { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// The NHL draft player ranking for each prospective player | ||
/// </summary> | ||
public class PlayerDraftRanking | ||
{ | ||
/// <summary> | ||
/// The last name of the player | ||
/// </summary> | ||
[JsonProperty("lastName")] | ||
public string LastName { get; set; } | ||
|
||
/// <summary> | ||
/// The first name of the player | ||
/// </summary> | ||
[JsonProperty("firstName")] | ||
public string FirstName { get; set; } | ||
|
||
/// <summary> | ||
/// The position code of the player | ||
/// </summary> | ||
[JsonProperty("positionCode")] | ||
public string PositionCode { get; set; } | ||
|
||
/// <summary> | ||
/// The shooting or catching hand of the player | ||
/// </summary> | ||
[JsonProperty("shootsCatches")] | ||
public string ShootsCatches { get; set; } | ||
|
||
/// <summary> | ||
/// The height of the player in inches | ||
/// </summary> | ||
[JsonProperty("heightInInches")] | ||
public int? HeightInInches { get; set; } | ||
|
||
/// <summary> | ||
/// The weight of the player in pounds | ||
/// </summary> | ||
[JsonProperty("weightInPounds")] | ||
public int? WeightInPounds { get; set; } | ||
|
||
/// <summary> | ||
/// The last amateur club of the player | ||
/// </summary> | ||
[JsonProperty("lastAmateurClub")] | ||
public string LastAmateurClub { get; set; } | ||
|
||
/// <summary> | ||
/// The last amateur league of the player | ||
/// </summary> | ||
[JsonProperty("lastAmateurLeague")] | ||
public string LastAmateurLeague { get; set; } | ||
|
||
/// <summary> | ||
/// The birth date of the player | ||
/// </summary> | ||
[JsonProperty("birthDate")] | ||
public string BirthDate { get; set; } | ||
|
||
/// <summary> | ||
/// The birth city of the player | ||
/// </summary> | ||
[JsonProperty("birthCity")] | ||
public string BirthCity { get; set; } | ||
|
||
/// <summary> | ||
/// The birth state or province of the player | ||
/// </summary> | ||
[JsonProperty("birthStateProvince")] | ||
public string BirthStateProvince { get; set; } | ||
|
||
/// <summary> | ||
/// The birth country of the player | ||
/// </summary> | ||
[JsonProperty("birthCountry")] | ||
public string BirthCountry { get; set; } | ||
|
||
/// <summary> | ||
/// The midterm rank of the player | ||
/// </summary> | ||
[JsonProperty("midtermRank")] | ||
public int? MidtermRank { get; set; } | ||
|
||
/// <summary> | ||
/// The final rank of the player | ||
/// </summary> | ||
[JsonProperty("finalRank")] | ||
public int? FinalRank { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// The NHL draft player draft year with all players and their information and rankings | ||
/// </summary> | ||
public class PlayerDraftYear | ||
{ | ||
/// <summary> | ||
/// The draft year | ||
/// </summary> | ||
[JsonProperty("draftYear")] | ||
public int? DraftYear { get; set; } | ||
|
||
/// <summary> | ||
/// The category ID | ||
/// </summary> | ||
[JsonProperty("categoryId")] | ||
public int? CategoryId { get; set; } | ||
|
||
/// <summary> | ||
/// The category key | ||
/// </summary> | ||
[JsonProperty("categoryKey")] | ||
public string? CategoryKey { get; set; } | ||
|
||
/// <summary> | ||
/// The list of draft years | ||
/// </summary> | ||
[JsonProperty("draftYears")] | ||
public List<int?> DraftYears { get; set; } = []; | ||
|
||
/// <summary> | ||
/// The list of player draft categories | ||
/// </summary> | ||
[JsonProperty("categories")] | ||
public List<PlayerDraftCategory> Categories { get; set; } = []; | ||
|
||
/// <summary> | ||
/// The list of player draft rankings | ||
/// </summary> | ||
[JsonProperty("rankings")] | ||
public List<PlayerDraftRanking> Rankings { get; set; } = []; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.