From dc14f21f27e2d08109fc565e1eb885d5e5380d8a Mon Sep 17 00:00:00 2001 From: Tom Eckstein Date: Tue, 18 May 2021 20:53:46 +0200 Subject: [PATCH 1/8] Apply changes from Match-V5 API --- .../Endpoints/Interfaces/IMatchEndpoint.cs | 30 +- RiotSharp/Endpoints/MatchEndpoint/Match.cs | 74 +-- .../Endpoints/MatchEndpoint/MatchEndpoint.cs | 71 +-- .../Endpoints/MatchEndpoint/MatchInfo.cs | 97 +++ .../Endpoints/MatchEndpoint/MatchMetadata.cs | 28 + .../Endpoints/MatchEndpoint/MatchTimeline.cs | 13 +- .../MatchEndpoint/MatchTimelineInfo.cs | 26 + .../Endpoints/MatchEndpoint/Participant.cs | 589 +++++++++++++++++- .../MatchEndpoint/ParticipantPerkSelection.cs | 36 ++ .../MatchEndpoint/ParticipantPerks.cs | 25 + .../ParticipantPerksStatPerks.cs | 30 + .../MatchEndpoint/ParticipantPerksStyle.cs | 31 + .../Endpoints/MatchEndpoint/TeamStats.cs | 78 +-- .../MatchEndpoint/TeamStatsObjectives.cs | 65 ++ 14 files changed, 938 insertions(+), 255 deletions(-) create mode 100644 RiotSharp/Endpoints/MatchEndpoint/MatchInfo.cs create mode 100644 RiotSharp/Endpoints/MatchEndpoint/MatchMetadata.cs create mode 100644 RiotSharp/Endpoints/MatchEndpoint/MatchTimelineInfo.cs create mode 100644 RiotSharp/Endpoints/MatchEndpoint/ParticipantPerkSelection.cs create mode 100644 RiotSharp/Endpoints/MatchEndpoint/ParticipantPerks.cs create mode 100644 RiotSharp/Endpoints/MatchEndpoint/ParticipantPerksStatPerks.cs create mode 100644 RiotSharp/Endpoints/MatchEndpoint/ParticipantPerksStyle.cs create mode 100644 RiotSharp/Endpoints/MatchEndpoint/TeamStatsObjectives.cs diff --git a/RiotSharp/Endpoints/Interfaces/IMatchEndpoint.cs b/RiotSharp/Endpoints/Interfaces/IMatchEndpoint.cs index 35804403..50dea232 100644 --- a/RiotSharp/Endpoints/Interfaces/IMatchEndpoint.cs +++ b/RiotSharp/Endpoints/Interfaces/IMatchEndpoint.cs @@ -11,41 +11,23 @@ namespace RiotSharp.Endpoints.Interfaces /// public interface IMatchEndpoint { - /// - /// Get the matches' ID of the specified tournament asynchronously. - /// - /// Region in which the tournament took place. - /// The tournament ID to be retrieved. - /// A list containing the matches' ID. - Task> GetMatchIdsByTournamentCodeAsync(Region region, string tournamentCode); - /// /// Get match information about a specific match asynchronously. /// - /// Region in which the match took place. + /// Region in which the match took place. (Europe, Asia, America) /// The match ID to be retrieved. /// A match object containing information about the match. - Task GetMatchAsync(Region region, long matchId); + Task GetMatchAsync(Region region, string matchId); /// /// Get the list of matches of a specific summoner asynchronously. /// /// Region in which the summoner is. - /// Account ID for which you want to retrieve the match list. - /// List of champion IDS to use for fetching games. - /// List of queue types to use for fetching games. - /// [DEPRECATED] This field should not be considered reliable for the purposes of filtering matches by season. - /// The earliest date you wish to get matches from. - /// The latest date you wish to get matches from. + /// PuuID for which you want to retrieve the match list. /// The begin index to use for fetching matches. /// The end index to use for fetching matches. - /// A list of Match references object. - Task GetMatchListAsync(Region region, string accountId, - List championIds = null, - List queues = null, - List seasons = null, - DateTime? beginTime = null, - DateTime? endTime = null, + /// A list of MatchIds. + Task> GetMatchListAsync(Region region, string puuidId, long? beginIndex = null, long? endIndex = null); @@ -54,6 +36,6 @@ Task GetMatchListAsync(Region region, string accountId, /// /// Region in which the summoner is. /// The match ID of the timeline to be retrieved. - Task GetMatchTimelineAsync(Region region, long matchId); + Task GetMatchTimelineAsync(Region region, string matchId); } } diff --git a/RiotSharp/Endpoints/MatchEndpoint/Match.cs b/RiotSharp/Endpoints/MatchEndpoint/Match.cs index b5ece4dd..e260d906 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/Match.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/Match.cs @@ -11,77 +11,15 @@ namespace RiotSharp.Endpoints.MatchEndpoint public class Match { /// - /// The season ID. + /// Metadata of the match. /// - [JsonProperty("seasonId")] - public int SeasonId { get; set; } + [JsonProperty("metadata")] + public MatchMetadata Metadata { get; set; } /// - /// Specifies the Queue ID. + /// Info containing the most information about the match. /// - [JsonProperty("queueId")] - public int QueueId { get; set; } - - /// - /// Equivalent to match id - /// - [JsonProperty("gameId")] - public long GameId { get; set; } - - /// - /// The participants identities. - /// - [JsonProperty("participantIdentities")] - public List ParticipantIdentities { get; set; } - - /// - /// The game version. - /// - [JsonProperty("gameVersion")] - public string GameVersion { get; set; } - - /// - /// The game mode. - /// - [JsonProperty("gameMode")] - public string GameMode { get; set; } - - /// - /// The map ID. - /// - [JsonProperty("MapId")] - public int MapId { get; set; } - - /// - /// The game type. - /// - [JsonProperty("gameType")] - public string GameType { get; set; } - - /// - /// The teams. - /// - [JsonProperty("teams")] - public List Teams { get; set; } - - /// - /// The participants. - /// - [JsonProperty("participants")] - public List Participants { get; set; } - - /// - /// The game duration. - /// - [JsonProperty("gameDuration")] - [JsonConverter(typeof(TimeSpanConverterFromSeconds))] - public TimeSpan GameDuration { get; set; } - - /// - /// The date time of the game creation. - /// - [JsonProperty("gameCreation")] - [JsonConverter(typeof(DateTimeConverterFromLong))] - public DateTime GameCreation { get; set; } + [JsonProperty("info")] + public MatchInfo Info { get; set; } } } diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchEndpoint.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchEndpoint.cs index bf5113d8..02dc74b2 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/MatchEndpoint.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/MatchEndpoint.cs @@ -15,14 +15,10 @@ namespace RiotSharp.Endpoints.MatchEndpoint /// public class MatchEndpoint : IMatchEndpoint { - private const string MatchRootUrl = "/lol/match/v4/matches"; - private const string MatchListRootUrl = "/lol/match/v4/matchlists"; - private const string TimelinesRootUrl = "/lol/match/v4/timelines"; - private const string MatchIdsByTournamentCodeUrl = "/by-tournament-code/{0}/ids"; + private const string MatchRootUrl = "/lol/match/v5/matches"; private const string MatchByIdUrl = "/{0}"; - private const string MatchByIdAndTournamentCodeUrl = "/{0}/by-tournament-code/{1}"; - private const string MatchListByAccountIdUrl = "/by-account/{0}"; - private const string TimelineByMatchIdUrl = "/by-match/{0}"; + private const string MatchListByPuuIdUrl = "/by-puuid/{0}/ids"; + private const string TimelineByMatchIdUrl = "/{0}/timeline"; private const string MatchCache = "match-{0}_{1}"; private const string MatchTimeLineCacheKey = "match-timeline-{0}_{1}"; private static readonly TimeSpan MatchTtl = TimeSpan.FromDays(60); @@ -42,17 +38,7 @@ public MatchEndpoint(IRateLimitedRequester requester, ICache cache) } /// - public async Task> GetMatchIdsByTournamentCodeAsync(Region region, string tournamentCode) - { - var json = await _requester.CreateGetRequestAsync(MatchRootUrl + - string.Format(MatchIdsByTournamentCodeUrl, tournamentCode), - region).ConfigureAwait(false); - - return JsonConvert.DeserializeObject>(json); - } - - /// - public async Task GetMatchAsync(Region region, long matchId) + public async Task GetMatchAsync(Region region, string matchId) { var matchInCache = _cache.Get(string.Format(MatchCache, region, matchId)); if (matchInCache != null) @@ -67,19 +53,18 @@ public async Task GetMatchAsync(Region region, long matchId) } /// - public async Task GetMatchListAsync(Region region, string accountId, List championIds = null, List queues = null, List seasons = null, - DateTime? beginTime = null, DateTime? endTime = null, long? beginIndex = null, long? endIndex = null) + public async Task> GetMatchListAsync(Region region, string puuId, + long? beginIndex = null, long? endIndex = null) { - var addedArguments = CreateArgumentsListForMatchListRequest(championIds, queues, seasons, beginTime, - endTime, beginIndex, endIndex); + var addedArguments = CreateArgumentsListForMatchListRequest(beginIndex, endIndex); - var json = await _requester.CreateGetRequestAsync(MatchListRootUrl + string.Format(MatchListByAccountIdUrl, accountId), + var json = await _requester.CreateGetRequestAsync(MatchRootUrl + string.Format(MatchListByPuuIdUrl, puuId), region, addedArguments).ConfigureAwait(false); - return JsonConvert.DeserializeObject(json); + return JsonConvert.DeserializeObject>(json); } /// - public async Task GetMatchTimelineAsync(Region region, long matchId) + public async Task GetMatchTimelineAsync(Region region, string matchId) { var cacheKey = string.Format(MatchTimeLineCacheKey, region, matchId); var matchTimeline = _cache.Get(cacheKey); @@ -87,7 +72,7 @@ public async Task GetMatchTimelineAsync(Region region, long match { return matchTimeline; } - var json = await _requester.CreateGetRequestAsync(TimelinesRootUrl + + var json = await _requester.CreateGetRequestAsync(MatchRootUrl + string.Format(TimelineByMatchIdUrl, matchId), region).ConfigureAwait(false); matchTimeline = JsonConvert.DeserializeObject(json); _cache.Add(cacheKey, matchTimeline, MatchTtl); @@ -97,11 +82,6 @@ public async Task GetMatchTimelineAsync(Region region, long match #region Helper private List CreateArgumentsListForMatchListRequest( - List championIds = null, - List queues = null, - List seasons = null, - DateTime? beginTime = null, - DateTime? endTime = null, long? beginIndex = null, long? endIndex = null) { @@ -114,35 +94,6 @@ private List CreateArgumentsListForMatchListRequest( { addedArguments.Add($"endIndex={endIndex}"); } - if (beginTime != null) - { - addedArguments.Add($"beginTime={beginTime.Value.ToLong()}"); - } - if (endTime != null) - { - addedArguments.Add($"endTime={endTime.Value.ToLong()}"); - } - if (championIds != null) - { - foreach (var championId in championIds) - { - addedArguments.Add($"champion={championId}"); - } - } - if (queues != null) - { - foreach (var queue in queues) - { - addedArguments.Add($"queue={queue}"); - } - } - if (seasons != null) - { - foreach (var season in seasons) - { - addedArguments.Add($"season={(int)season}"); - } - } return addedArguments; } diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchInfo.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchInfo.cs new file mode 100644 index 00000000..79920200 --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/MatchInfo.cs @@ -0,0 +1,97 @@ +using Newtonsoft.Json; +using RiotSharp.Misc.Converters; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + /// + /// Info of a match (Match API). + /// + public class MatchInfo + { + internal MatchInfo() { } + + /// + /// The date time of the game creation. + /// + [JsonProperty("gameCreation")] + [JsonConverter(typeof(DateTimeConverterFromLong))] + public DateTime GameCreation { get; set; } + + /// + /// The game duration. + /// + [JsonProperty("gameDuration")] + [JsonConverter(typeof(TimeSpanConverterFromSeconds))] + public TimeSpan GameDuration { get; set; } + + /// + /// Game ID. + /// + [JsonProperty("gameId")] + public long GameId { get; set; } + + /// + /// The game mode. + /// + [JsonProperty("gameMode")] + public string GameMode { get; set; } + + /// + /// Name of the game. + /// + [JsonProperty("gameName")] + public long GameName { get; set; } + + /// + /// The date time of the game start. + /// + [JsonProperty("gameStartTimeStemp")] + [JsonConverter(typeof(DateTimeConverterFromLong))] + public DateTime GameStartTimeStemp { get; set; } + + /// + /// The game type. + /// + [JsonProperty("gameType")] + public string GameType { get; set; } + + /// + /// The game version. + /// + [JsonProperty("gameVersion")] + public string GameVersion { get; set; } + + /// + /// The map ID. + /// + [JsonProperty("MapId")] + public int MapId { get; set; } + + /// + /// The participants. + /// + [JsonProperty("participants")] + public List Participants { get; set; } + + /// + /// Platform Id. + /// + [JsonProperty("platformId")] + public string PlatformId { get; set; } + + /// + /// Specifies the Queue ID. + /// + [JsonProperty("queueId")] + public int QueueId { get; set; } + + /// + /// The teams. + /// + [JsonProperty("teams")] + public List Teams { get; set; } + } +} diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchMetadata.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchMetadata.cs new file mode 100644 index 00000000..99b8e8d9 --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/MatchMetadata.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + public class MatchMetadata + { + /// + /// Data Version of the data. + /// + [JsonProperty("dataVersion")] + public string DataVersion { get; set; } + + /// + /// Match ID of the match. + /// + [JsonProperty("matchId")] + public string MatchId { get; set; } + + /// + /// Participant Puuids. + /// + [JsonProperty("participants")] + public List Participants { get; set; } + } +} diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchTimeline.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchTimeline.cs index c1f61627..c35f034a 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/MatchTimeline.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/MatchTimeline.cs @@ -13,16 +13,15 @@ public class MatchTimeline internal MatchTimeline() { } /// - /// Time between each returned frame. + /// Metadata of the match /// - [JsonProperty("frameInterval")] - [JsonConverter(typeof(TimeSpanConverterFromMilliseconds))] - public TimeSpan FrameInterval { get; set; } + [JsonProperty("metadata")] + public MatchMetadata Metadata { get; set; } /// - /// List of timeline frames for the game. + /// Info containing the most information about the match timeline. /// - [JsonProperty("frames")] - public List Frames { get; set; } + [JsonProperty("info")] + public MatchTimelineInfo Info { get; set; } } } diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchTimelineInfo.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchTimelineInfo.cs new file mode 100644 index 00000000..2a062cdc --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/MatchTimelineInfo.cs @@ -0,0 +1,26 @@ +using Newtonsoft.Json; +using RiotSharp.Misc.Converters; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + public class MatchTimelineInfo + { + internal MatchTimelineInfo() { } + + /// + /// Time between each returned frame. + /// + [JsonProperty("frameInterval")] + [JsonConverter(typeof(TimeSpanConverterFromMilliseconds))] + public TimeSpan FrameInterval { get; set; } + + /// + /// List of timeline frames for the game. + /// + [JsonProperty("frames")] + public List Frames { get; set; } + } +} diff --git a/RiotSharp/Endpoints/MatchEndpoint/Participant.cs b/RiotSharp/Endpoints/MatchEndpoint/Participant.cs index 6cbbc737..5c3267c0 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/Participant.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/Participant.cs @@ -1,6 +1,9 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Newtonsoft.Json; using RiotSharp.Endpoints.LeagueEndpoint.Enums; +using RiotSharp.Misc; +using RiotSharp.Misc.Converters; namespace RiotSharp.Endpoints.MatchEndpoint { @@ -11,6 +14,36 @@ public class Participant { internal Participant() { } + /// + /// Number of assists. + /// + [JsonProperty("assists")] + public long Assists { get; set; } + + /// + /// Number of baron kills. + /// + [JsonProperty("baronKills")] + public long BaronKills { get; set; } + + /// + /// Level of bounty on the champion. + /// + [JsonProperty("bountyLevel")] + public long BountyLevel { get; set; } + + /// + /// Experience of the champion. + /// + [JsonProperty("champExperience")] + public long ChampExperience { get; set; } + + /// + /// Champion level achieved. + /// + [JsonProperty("champLevel")] + public long ChampLevel { get; set; } + /// /// Champion ID. /// @@ -18,10 +51,276 @@ internal Participant() { } public int ChampionId { get; set; } /// - /// List of mastery information. + /// Champion ID. + /// + [JsonProperty("championName")] + public string ChampionName { get; set; } + + /// + /// Champion Transformation. + /// + [JsonProperty("championTransform")] + public int ChampionTransform { get; set; } + + /// + /// Consumables purchased. + /// + [JsonProperty("consumablesPurchased")] + public long ConsumablesPurchased { get; set; } + + /// + /// Damage dealt to buildings. + /// + [JsonProperty("damageDealtToBuildings")] + public long DamageDealtToBuildings { get; set; } + + /// + /// Damage dealt to objectives. + /// + [JsonProperty("damageDealtToObjectives")] + public long DamageDealtToObjectives { get; set; } + + /// + /// Damage dealt to turrets. + /// + [JsonProperty("damageDealtToTurrets")] + public long DamageDealtToTurrets { get; set; } + + /// + /// Damage self mitigated. + /// + [JsonProperty("damageSelfMitigated")] + public long DamageSelfMitigated { get; set; } + + /// + /// Number of deaths. + /// + [JsonProperty("deaths")] + public long Deaths { get; set; } + + /// + /// Number of detector wards placed. + /// + [JsonProperty("detectorWardsPlaced")] + public long DetectorWardsPlaced { get; set; } + + /// + /// Number of double kills. + /// + [JsonProperty("doubleKills")] + public long DoubleKills { get; set; } + + /// + /// Number of dragon kills. + /// + [JsonProperty("dragonKills")] + public long DragonKills { get; set; } + + /// + /// Flag indicating if participant got an assist on first blood. + /// + [JsonProperty("firstBloodAssist")] + public bool FirstBloodAssist { get; set; } + + /// + /// Flag indicating if participant got first blood. + /// + [JsonProperty("firstBloodKill")] + public bool FirstBloodKill { get; set; } + + /// + /// Flag indicating if participant got an assist on first blood turret. + /// + [JsonProperty("firstBloodTurretAssist")] + public bool FirstBloodTurretAssist { get; set; } + + /// + /// Flag indicating if participant got first blood turret. + /// + [JsonProperty("firstBloodTurretKill")] + public bool FirstBloodTurretKill { get; set; } + + /// + /// Flag indicating if game ended in early surrender. + /// + [JsonProperty("gameEndedInEarlySurrender")] + public bool GameEndedInEarlySurrender { get; set; } + + /// + /// Flag indicating if game ended in surrender. + /// + [JsonProperty("gameEndedInSurrender")] + public bool GameEndedInSurrender { get; set; } + + /// + /// Gold earned. + /// + [JsonProperty("goldEarned")] + public long GoldEarned { get; set; } + + /// + /// Gold spent. + /// + [JsonProperty("goldSpent")] + public long GoldSpent { get; set; } + + /// + /// Gold spent. + /// + [JsonProperty("individualPosition")] + public string IndividualPosition { get; set; } + + /// + /// Numer of inhibitor kills. + /// + [JsonProperty("inhibitorKills")] + public long InhibitorKills { get; set; } + + /// + /// Numer of inhibitor kills. + /// + [JsonProperty("inhibitorsLost")] + public long InhibitorsLost { get; set; } + + /// + /// First item ID. + /// + [JsonProperty("item0")] + public long Item0 { get; set; } + + /// + /// Second item ID. + /// + [JsonProperty("item1")] + public long Item1 { get; set; } + + /// + /// Third item ID. + /// + [JsonProperty("item2")] + public long Item2 { get; set; } + + /// + /// Fourth item ID. + /// + [JsonProperty("item3")] + public long Item3 { get; set; } + + /// + /// Fifth item ID. + /// + [JsonProperty("item4")] + public long Item4 { get; set; } + + /// + /// Sixth item ID. + /// + [JsonProperty("item5")] + public long Item5 { get; set; } + + /// + /// Seventh item ID. + /// + [JsonProperty("item6")] + public long Item6 { get; set; } + + /// + /// Items purchased + /// + [JsonProperty("itemsPurchased")] + public long ItemsPurchased { get; set; } + + /// + /// Number of killing sprees. + /// + [JsonProperty("killingSprees")] + public long KillingSprees { get; set; } + + /// + /// Number of kills. + /// + [JsonProperty("kills")] + public long Kills { get; set; } + + /// + /// Number of kills. + /// + [JsonProperty("lane")] + [JsonConverter(typeof(LaneConverter))] + public Lane Lane { get; set; } + + /// + /// Largest critical strike. + /// + [JsonProperty("largestCriticalStrike")] + public long LargestCriticalStrike { get; set; } + + /// + /// Largest killing spree. + /// + [JsonProperty("largestKillingSpree")] + public long LargestKillingSpree { get; set; } + + /// + /// Largest multi kill. + /// + [JsonProperty("largestMultiKill")] + public long LargestMultiKill { get; set; } + + /// + /// Largest multi kill. + /// + [JsonProperty("longestTimeSpentLiving")] + [JsonConverter(typeof(TimeSpanConverterFromSeconds))] + public TimeSpan LongestTimeSpentLiving { get; set; } + + /// + /// Magic damage dealt. + /// + [JsonProperty("magicDamageDealt")] + public long MagicDamageDealt { get; set; } + + /// + /// Magic damage dealt to champions. + /// + [JsonProperty("magicDamageDealtToChampions")] + public long MagicDamageDealtToChampions { get; set; } + + /// + /// Magic damage taken. + /// + [JsonProperty("magicDamageTaken")] + public long MagicDamageTaken { get; set; } + + /// + /// Neutral minions killed. + /// + [JsonProperty("neutralMinionsKilled")] + public long NeutralMinionsKilled { get; set; } + + /// + /// Numer of nexus kills. + /// + [JsonProperty("nexusKills")] + public int NexusKills { get; set; } + + /// + /// Numer of nexus kills. + /// + [JsonProperty("nexusLost")] + public int NexusLost { get; set; } + + /// + /// Numer of nexus kills. + /// + [JsonProperty("objectivesStolen")] + public long ObjectivesStolen { get; set; } + + /// + /// Numer of nexus kills. /// - [JsonProperty("masteries")] - public List Masteries { get; set; } + [JsonProperty("objectivesStolenAssists")] + public long ObjectivesStolenAssists { get; set; } /// /// Participant ID. @@ -30,28 +329,146 @@ internal Participant() { } public int ParticipantId { get; set; } /// - /// List of rune information. + /// Number of penta kills. + /// + [JsonProperty("pentaKills")] + public long PentaKills { get; set; } + + [JsonProperty("perks")] + public ParticipantPerks Perks { get; set; } + + /// + /// Physical damage dealt. + /// + [JsonProperty("physicalDamageDealt")] + public long PhysicalDamageDealt { get; set; } + + /// + /// Physical damage dealt to champions. /// - [JsonProperty("runes")] - public List Runes { get; set; } + [JsonProperty("physicalDamageDealtToChampions")] + public long PhysicalDamageDealtToChampions { get; set; } + + /// + /// Physical damage taken. + /// + [JsonProperty("physicalDamageTaken")] + public long PhysicalDamageTaken { get; set; } + + /// + /// Id of the participants profil icon. + /// + [JsonProperty("profilIcon")] + public long ProfilIcon { get; set; } + + /// + /// Puuid. + /// + [JsonProperty("puuid")] + public string Puuid { get; set; } + + /// + /// Number of quadra kills. + /// + [JsonProperty("quadraKills")] + public long QuadraKills { get; set; } + + /// + /// Riot id name. + /// + [JsonProperty("riotIdName")] + public string RiotIdName { get; set; } + + /// + /// Riot id tagline. + /// + [JsonProperty("riotIdTagline")] + public string RiotIdTagline { get; set; } + + /// + /// Role. + /// + [JsonProperty("role")] + [JsonConverter(typeof(RoleConverter))] + public Role Role { get; set; } + + /// + /// Number of sight wards purchased. + /// + [JsonProperty("sightWardsBoughtInGame")] + public long SightWardsBoughtInGame { get; set; } + + /// + /// Spell casts of the first spell. + /// + [JsonProperty("spell1Casts")] + public long Spell1Casts { get; set; } + + /// + /// Spell casts of the second spell. + /// + [JsonProperty("spell2Casts")] + public long Spell2Casts { get; set; } + + /// + /// Spell casts of the third spell. + /// + [JsonProperty("spell3Casts")] + public long Spell3Casts { get; set; } + + /// + /// Spell casts of the forth spell. + /// + [JsonProperty("spell4Casts")] + public long Spell4Casts { get; set; } /// /// First summoner spell ID. /// - [JsonProperty("spell1Id")] - public int Spell1Id { get; set; } + [JsonProperty("summoner1Id")] + public int Summoner1Id { get; set; } + + /// + /// Number of summoner 1 casts. + /// + [JsonProperty("summoner1Casts")] + public long Summoner1Casts { get; set; } /// /// Second summoner spell ID. /// - [JsonProperty("spell2Id")] - public int Spell2Id { get; set; } + [JsonProperty("summoner2Id")] + public int Summoner2Id { get; set; } + + /// + /// Number of summoner 2 casts. + /// + [JsonProperty("summoner2Casts")] + public long Summoner2Casts { get; set; } + + /// + /// Encrypted summoner ID. + /// + [JsonProperty("summonerId")] + public string SummonerId { get; set; } + + /// + /// Level of the summoner. + /// + [JsonProperty("summonerLevel")] + public long SummonerLevel { get; set; } + + /// + /// Name of the summoner. + /// + [JsonProperty("summonerName")] + public string SummonerName { get; set; } /// - /// Participant statistics. + /// Flag whether team surrendered early. /// - [JsonProperty("stats")] - public ParticipantStats Stats { get; set; } + [JsonProperty("teamEarlySurrendered")] + public bool TeamEarlySurrendered { get; set; } /// /// Team ID. @@ -60,15 +477,145 @@ internal Participant() { } public int TeamId { get; set; } /// - /// Timeline data. + /// Team position. /// - [JsonProperty("timeline")] - public ParticipantTimeline Timeline { get; set; } - + [JsonProperty("teamPosition")] + public string TeamPosition { get; set; } + + /// + /// Time crowd controling others. + /// + [JsonProperty("timeCCingOthers")] + public long TimeCCingOthers { get; set; } + + + /// + /// Minions kiled. + /// + [JsonProperty("totalMinionsKilled")] + public long TotalMinionsKilled { get; set; } + + + + + /// + /// If game was a dominion game, number of completed team objectives (i.e., quests). + /// + [JsonProperty("teamObjective")] + public long TeamObjective { get; set; } + + /// + /// Total damage dealt. + /// + [JsonProperty("totalDamageDealt")] + public long TotalDamageDealt { get; set; } + + /// + /// Total damage dealt to champions. + /// + [JsonProperty("totalDamageDealtToChampions")] + public long TotalDamageDealtToChampions { get; set; } + + /// + /// Total damage taken. + /// + [JsonProperty("totalDamageTaken")] + public long TotalDamageTaken { get; set; } + + /// + /// Total heal. + /// + [JsonProperty("totalHeal")] + public long TotalHeal { get; set; } + + /// + /// If game was a dominion game, player's total score, otherwise 0. + /// + [JsonProperty("totalPlayerScore")] + public long TotalPlayerScore { get; set; } + + /// + /// If game was a dominion game, team rank of the player's total score (e.g., 1-5). + /// + [JsonProperty("totalScoreRank")] + public long TotalScoreRank { get; set; } + + /// + /// Total time crowd control dealt. + /// + [JsonProperty("totalTimeCrowdControlDealt")] + public long TotalTimeCrowdControlDealt { get; set; } + + /// + /// Total units healed. + /// + [JsonProperty("totalUnitsHealed")] + public long TotalUnitsHealed { get; set; } + + /// + /// Number of tower kills. + /// + [JsonProperty("towerKills")] + public long TowerKills { get; set; } + + /// + /// Number of triple kills. + /// + [JsonProperty("tripleKills")] + public long TripleKills { get; set; } + + /// + /// True damage dealt. + /// + [JsonProperty("trueDamageDealt")] + public long TrueDamageDealt { get; set; } + + /// + /// True damage dealt to champions. + /// + [JsonProperty("trueDamageDealtToChampions")] + public long TrueDamageDealtToChampions { get; set; } + + /// + /// True damage taken. + /// + [JsonProperty("trueDamageTaken")] + public long TrueDamageTaken { get; set; } + + /// + /// Number of unreal kills. + /// + [JsonProperty("unrealKills")] + public long UnrealKills { get; set; } + + /// + /// Vision score. + /// + [JsonProperty("visionScore")] + public long VisionScore { get; set; } + + /// + /// Number of vision wards purchased. + /// + [JsonProperty("visionWardsBoughtInGame")] + public long VisionWardsBoughtInGame { get; set; } + + /// + /// Number of wards killed. + /// + [JsonProperty("wardsKilled")] + public long WardsKilled { get; set; } + + /// + /// Number of wards placed. + /// + [JsonProperty("wardsPlaced")] + public long WardsPlaced { get; set; } + /// - /// Highest achieved season tier. + /// Flag indicating whether or not the participant won. /// - [JsonProperty("highestAchievedSeasonTier")] - public Tier HighestAchievedSeasonTier { get; set; } + [JsonProperty("win")] + public bool Winner { get; set; } } } diff --git a/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerkSelection.cs b/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerkSelection.cs new file mode 100644 index 00000000..3dd90a4b --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerkSelection.cs @@ -0,0 +1,36 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + public class ParticipantPerkSelection + { + internal ParticipantPerkSelection() { } + + /// + /// Perk Id of the + /// + [JsonProperty("perk")] + public int Perk { get; set; } + + /// + /// Post game rune stat of perk. + /// + [JsonProperty("var1")] + public int Var1 { get; set; } + + /// + /// Post game rune stat of perk. + /// + [JsonProperty("var2")] + public int Var2 { get; set; } + + /// + /// Post game rune stat of perk. + /// + [JsonProperty("var3")] + public int Var3 { get; set; } + } +} diff --git a/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerks.cs b/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerks.cs new file mode 100644 index 00000000..b8c2baae --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerks.cs @@ -0,0 +1,25 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + public class ParticipantPerks + { + internal ParticipantPerks() { } + + /// + /// Stat perks selected by participant. + /// + [JsonProperty("statPerks")] + public ParticipantPerksStatPerks StatPerks { get; set; } + + /// + /// Styles and perks selected by participant. + /// + [JsonProperty("styles")] + public List Styles { get; set; } + + } +} diff --git a/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerksStatPerks.cs b/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerksStatPerks.cs new file mode 100644 index 00000000..489c053c --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerksStatPerks.cs @@ -0,0 +1,30 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + public class ParticipantPerksStatPerks + { + internal ParticipantPerksStatPerks() { } + + /// + /// Perk Id of the defense stat perk. + /// + [JsonProperty("defense")] + public int Defense { get; set; } + + /// + /// Perk Id of the flex stat perk. + /// + [JsonProperty("flex")] + public int Flex { get; set; } + + /// + /// Perk Id of the offense stat perk. + /// + [JsonProperty("offense")] + public int Offense { get; set; } + } +} diff --git a/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerksStyle.cs b/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerksStyle.cs new file mode 100644 index 00000000..f17e3692 --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/ParticipantPerksStyle.cs @@ -0,0 +1,31 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + public class ParticipantPerksStyle + { + internal ParticipantPerksStyle() { } + + /// + /// Description of the Style.
+ /// Values might be 'primaryStyle' or 'subStyle' + ///
+ [JsonProperty("description")] + public string Description { get; set; } + + /// + /// Selected perks of this style. + /// + [JsonProperty("selections")] + public List Selections { get; set; } + + /// + /// Style Id. + /// + [JsonProperty("style")] + public int Style { get; set; } + } +} diff --git a/RiotSharp/Endpoints/MatchEndpoint/TeamStats.cs b/RiotSharp/Endpoints/MatchEndpoint/TeamStats.cs index 562a909b..8b6a981a 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/TeamStats.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/TeamStats.cs @@ -17,70 +17,10 @@ internal TeamStats() { } public List Bans { get; set; } /// - /// Number of times the team killed baron. + /// Information about the objectives the team took. /// - [JsonProperty("baronKills")] - public int BaronKills { get; set; } - - /// - /// If game was a dominion game, specifies the points the team had at game end, otherwise null. - /// - [JsonProperty("dominionVictoryScore")] - public long DominionVictoryScore { get; set; } - - /// - /// Number of times the team killed dragon. - /// - [JsonProperty("dragonKills")] - public int DragonKills { get; set; } - - /// - /// Flag indicating whether or not the team got the first baron kill. - /// - [JsonProperty("firstBaron")] - public bool FirstBaron { get; set; } - - /// - /// Flag indicating whether or not the team got first blood. - /// - [JsonProperty("firstBlood")] - public bool FirstBlood { get; set; } - - /// - /// Flag indicating whether or not the team got the first dragon kill. - /// - [JsonProperty("firstDragon")] - public bool FirstDragon { get; set; } - - /// - /// Flag indicating whether or not the team destroyed the first inhibitor. - /// - [JsonProperty("firstInhibitor")] - public bool FirstInhibitor { get; set; } - - /// - /// Flag indicating whether or not the team killed the first rift herald. - /// - [JsonProperty("firstRiftHerald")] - public bool FirstRiftHerald { get; set; } - - /// - /// Flag indicating whether or not the team destroyed the first tower. - /// - [JsonProperty("firstTower")] - public bool FirstTower { get; set; } - - /// - /// Number of inhibitors the team destroyed. - /// - [JsonProperty("inhibitorKills")] - public int InhibitorKills { get; set; } - - /// - /// Number of rift heralds killed. - /// - [JsonProperty("riftHeraldKills")] - public int RiftHeraldKills { get; set; } + [JsonProperty("objectives")] + public TeamStatsObjectives Objectives { get; set; } /// /// Team ID. @@ -88,18 +28,6 @@ internal TeamStats() { } [JsonProperty("teamId")] public int TeamId { get; set; } - /// - /// Number of towers the team destroyed. - /// - [JsonProperty("towerKills")] - public int TowerKills { get; set; } - - /// - /// Number of times the team killed vilemaw (Twisted Treeline epic monster). - /// - [JsonProperty("vilemawKills")] - public int VilemawKills { get; set; } - /// /// A string indicating whether or not the team won. /// diff --git a/RiotSharp/Endpoints/MatchEndpoint/TeamStatsObjectives.cs b/RiotSharp/Endpoints/MatchEndpoint/TeamStatsObjectives.cs new file mode 100644 index 00000000..da3e249c --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/TeamStatsObjectives.cs @@ -0,0 +1,65 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + public class TeamStatsObjectives + { + internal TeamStatsObjectives() { } + + /// + /// Baron objective. + /// + [JsonProperty("baron")] + public TeamStatsObjective Baron { get; set; } + + /// + /// Champion objective. + /// + [JsonProperty("champion")] + public TeamStatsObjective Champion { get; set; } + + /// + /// Dragon objective. + /// + [JsonProperty("dragon")] + public TeamStatsObjective Dragon { get; set; } + + /// + /// Inhibitor objective. + /// + [JsonProperty("inhibitor")] + public TeamStatsObjective Inhibitor { get; set; } + + /// + /// RiftHerald objective. + /// + [JsonProperty("riftHerald")] + public TeamStatsObjective RiftHerald { get; set; } + + /// + /// Tower objective. + /// + [JsonProperty("tower")] + public TeamStatsObjective Tower { get; set; } + } + + public class TeamStatsObjective + { + internal TeamStatsObjective() { } + + /// + /// Flag whether team got the objective first. + /// + [JsonProperty("first")] + public bool First { get; set; } + + /// + /// Number of kills of the objective. + /// + [JsonProperty("kills")] + public long Kills { get; set; } + } +} From 19f1606634a249f65b04e31c91b93a56e1870f96 Mon Sep 17 00:00:00 2001 From: Tom Eckstein Date: Wed, 19 May 2021 10:53:16 +0200 Subject: [PATCH 2/8] Add further support for MatchV5 --- .../Converters/MatchEventTypeConverter.cs | 2 + .../MatchEndpoint/Enums/MatchEventType.cs | 4 ++ .../Endpoints/MatchEndpoint/Participant.cs | 57 ++++++++++--------- 3 files changed, 36 insertions(+), 27 deletions(-) diff --git a/RiotSharp/Endpoints/MatchEndpoint/Enums/Converters/MatchEventTypeConverter.cs b/RiotSharp/Endpoints/MatchEndpoint/Enums/Converters/MatchEventTypeConverter.cs index ca73e666..e82b5edf 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/Enums/Converters/MatchEventTypeConverter.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/Enums/Converters/MatchEventTypeConverter.cs @@ -38,6 +38,8 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist return MatchEventType.ItemSold; case "ITEM_UNDO": return MatchEventType.ItemUndo; + case "PAUSE_END": + return MatchEventType.PauseEnd; case "SKILL_LEVEL_UP": return MatchEventType.SkillLevelUp; case "WARD_KILL": diff --git a/RiotSharp/Endpoints/MatchEndpoint/Enums/MatchEventType.cs b/RiotSharp/Endpoints/MatchEndpoint/Enums/MatchEventType.cs index fb2e423e..ce5f2596 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/Enums/MatchEventType.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/Enums/MatchEventType.cs @@ -54,6 +54,8 @@ public enum MatchEventType /// ItemUndo, + PauseEnd, + /// /// Triggers on skill level ups. /// @@ -94,6 +96,8 @@ public static string ToCustomString(this MatchEventType eventType) return "ITEM_SOLD"; case MatchEventType.ItemUndo: return "ITEM_UNDO"; + case MatchEventType.PauseEnd: + return "PAUSE_END"; case MatchEventType.SkillLevelUp: return "SKILL_LEVEL_UP"; case MatchEventType.WardKill: diff --git a/RiotSharp/Endpoints/MatchEndpoint/Participant.cs b/RiotSharp/Endpoints/MatchEndpoint/Participant.cs index 5c3267c0..dbd8ec2d 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/Participant.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/Participant.cs @@ -488,21 +488,12 @@ internal Participant() { } [JsonProperty("timeCCingOthers")] public long TimeCCingOthers { get; set; } - /// - /// Minions kiled. - /// - [JsonProperty("totalMinionsKilled")] - public long TotalMinionsKilled { get; set; } - - - - - /// - /// If game was a dominion game, number of completed team objectives (i.e., quests). + /// Time crowd controling others. /// - [JsonProperty("teamObjective")] - public long TeamObjective { get; set; } + [JsonProperty("timePlayed")] + [JsonConverter(typeof(TimeSpanConverterFromSeconds))] + public TimeSpan timePlayed { get; set; } /// /// Total damage dealt. @@ -516,6 +507,12 @@ internal Participant() { } [JsonProperty("totalDamageDealtToChampions")] public long TotalDamageDealtToChampions { get; set; } + /// + /// Total damage shielded on teammates. + /// + [JsonProperty("totalDamageShieldedOnTeammates")] + public long TotalDamageShieldedOnTeammates { get; set; } + /// /// Total damage taken. /// @@ -529,22 +526,22 @@ internal Participant() { } public long TotalHeal { get; set; } /// - /// If game was a dominion game, player's total score, otherwise 0. + /// Total heals on teammates. /// - [JsonProperty("totalPlayerScore")] - public long TotalPlayerScore { get; set; } + [JsonProperty("totalHealsOnTeammates")] + public long TotalHealsOnTeammates { get; set; } /// - /// If game was a dominion game, team rank of the player's total score (e.g., 1-5). + /// Minions kiled. /// - [JsonProperty("totalScoreRank")] - public long TotalScoreRank { get; set; } + [JsonProperty("totalMinionsKilled")] + public long TotalMinionsKilled { get; set; } /// /// Total time crowd control dealt. /// - [JsonProperty("totalTimeCrowdControlDealt")] - public long TotalTimeCrowdControlDealt { get; set; } + [JsonProperty("totalTimeCCDealt")] + public long TotalTimeCCDealt { get; set; } /// /// Total units healed. @@ -552,12 +549,6 @@ internal Participant() { } [JsonProperty("totalUnitsHealed")] public long TotalUnitsHealed { get; set; } - /// - /// Number of tower kills. - /// - [JsonProperty("towerKills")] - public long TowerKills { get; set; } - /// /// Number of triple kills. /// @@ -582,6 +573,18 @@ internal Participant() { } [JsonProperty("trueDamageTaken")] public long TrueDamageTaken { get; set; } + /// + /// Number of tower kills. + /// + [JsonProperty("turretKills")] + public long TurretKills { get; set; } + + /// + /// Number of turrets lost. + /// + [JsonProperty("turretsLost")] + public long TurretsLost { get; set; } + /// /// Number of unreal kills. /// From f4ad14712a3df734592d22b8599847c242d0219e Mon Sep 17 00:00:00 2001 From: Tom Eckstein Date: Wed, 19 May 2021 10:56:54 +0200 Subject: [PATCH 3/8] Ensure Support of Tournament Match API --- .../Endpoints/TournamentEndpoint/Mastery.cs | 24 + .../TournamentEndpoint/MatchDetail.cs | 25 + .../TournamentEndpoint/MatchEvent.cs | 150 +++++ .../TournamentEndpoint/MatchFrame.cs | 34 ++ .../TournamentEndpoint/MatchSummary.cs | 92 +++ .../TournamentEndpoint/MatchTimeline.cs | 28 + .../TournamentEndpoint/Participant.cs | 74 +++ .../TournamentEndpoint/ParticipantFrame.cs | 60 ++ .../TournamentEndpoint/ParticipantIdentity.cs | 24 + .../TournamentEndpoint/ParticipantStats.cs | 538 ++++++++++++++++++ .../TournamentEndpoint/ParticipantTimeline.cs | 71 +++ .../Endpoints/TournamentEndpoint/Player.cs | 61 ++ .../Endpoints/TournamentEndpoint/Position.cs | 24 + .../Endpoints/TournamentEndpoint/Rune.cs | 24 + .../Endpoints/TournamentEndpoint/TeamBan.cs | 23 + .../Endpoints/TournamentEndpoint/TeamStats.cs | 109 ++++ RiotSharp/Interfaces/ITournamentRiotApi.cs | 1 - RiotSharp/TournamentRiotApi.cs | 1 - 18 files changed, 1361 insertions(+), 2 deletions(-) create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/Mastery.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/MatchDetail.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/MatchEvent.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/MatchFrame.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/MatchSummary.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/MatchTimeline.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/Participant.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/ParticipantFrame.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/ParticipantIdentity.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/ParticipantStats.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/ParticipantTimeline.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/Player.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/Position.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/Rune.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/TeamBan.cs create mode 100644 RiotSharp/Endpoints/TournamentEndpoint/TeamStats.cs diff --git a/RiotSharp/Endpoints/TournamentEndpoint/Mastery.cs b/RiotSharp/Endpoints/TournamentEndpoint/Mastery.cs new file mode 100644 index 00000000..5320284d --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/Mastery.cs @@ -0,0 +1,24 @@ +using Newtonsoft.Json; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Class representing a mastery of a participant (Match API). + /// + public class Mastery + { + internal Mastery() { } + + /// + /// Mastery ID. + /// + [JsonProperty("masteryId")] + public int MasteryId { get; set; } + + /// + /// Mastery rank. + /// + [JsonProperty("rank")] + public int Rank { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/MatchDetail.cs b/RiotSharp/Endpoints/TournamentEndpoint/MatchDetail.cs new file mode 100644 index 00000000..c74da10b --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/MatchDetail.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Details about a match (Match API). + /// + public class MatchDetail : MatchSummary + { + internal MatchDetail() { } + + /// + /// Team information. + /// + [JsonProperty("teams")] + public List Teams { get; set; } + + /// + /// Match timeline data. Not included by default. + /// + [JsonProperty("timeline")] + public MatchTimeline Timeline { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/MatchEvent.cs b/RiotSharp/Endpoints/TournamentEndpoint/MatchEvent.cs new file mode 100644 index 00000000..229a762c --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/MatchEvent.cs @@ -0,0 +1,150 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; +using RiotSharp.Endpoints.MatchEndpoint.Enums; +using RiotSharp.Misc.Converters; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Class representing a particular event during a match (Match API). + /// + public class MatchEvent + { + internal MatchEvent() { } + + /// + /// The ascended type of the event. Only present if relevant. + /// Note that CLEAR_ASCENDED refers to when a participants kills the ascended player. + /// + [JsonProperty("ascendedType")] + public AscendedType AscendedType { get; set; } + + /// + /// The assisting participant IDs of the event. Only present if relevant. + /// + [JsonProperty("assistingParticipantIds")] + public List AssistingParticipantIds { get; set; } + + /// + /// The building type of the event (tower or inhibitor). Only present if relevant. + /// + [JsonProperty("buildingType")] + public BuildingType? BuildingType { get; set; } + + /// + /// The creator ID of the event. Only present if relevant. + /// + [JsonProperty("creatorId")] + public int CreatorId { get; set; } + + /// + /// Event type (building kills, champion kills, ward placements, items purchases, etc). + /// + [JsonProperty("type")] + public MatchEventType? EventType { get; set; } + + /// + /// The ending item ID of the event. Only present if relevant. + /// + [JsonProperty("afterId")] + public int ItemAfterId { get; set; } + + /// + /// The starting item ID of the event. Only present if relevant. + /// + [JsonProperty("beforeId")] + public int ItemBeforeId { get; set; } + + /// + /// The item ID of the event. Only present if relevant. + /// + [JsonProperty("itemId")] + public int ItemId { get; set; } + + /// + /// The killer ID of the event. Only present if relevant. + /// + [JsonProperty("killerId")] + public int KillerId { get; set; } + + /// + /// The lane type of the event. Only present if relevant. + /// + [JsonProperty("laneType")] + public LaneType? LaneType { get; set; } + + /// + /// The level up type of the event. Only present if relevant. + /// + [JsonProperty("levelUpType")] + public LevelUpType? LevelUpType { get; set; } + + /// + /// The monster type of the event. Only present if relevant. + /// + [JsonProperty("monsterType")] + public MonsterType? MonsterType { get; set; } + + /// + /// The monster type of the event. Only present if relevant. + /// + [JsonProperty("monsterSubType")] + public MonsterSubType? MonsterSubType { get; set; } + + /// + /// The participant ID of the event. Only present if relevant. + /// + [JsonProperty("participantId")] + public int ParticipantId { get; set; } + + /// + /// The point captured in the event. Only present if relevant. + /// + [JsonProperty("pointCaptured")] + public CapturedPoint? CapturedPoint { get; set; } + + /// + /// The position of the event. Only present if relevant. + /// + [JsonProperty("position")] + public Position Position { get; set; } + + /// + /// The skill slot of the event. Only present if relevant. + /// + [JsonProperty("skillSlot")] + public int SkillSlot { get; set; } + + /// + /// The team ID of the event. Only present if relevant. + /// + [JsonProperty("teamId")] + public int TeamId { get; set; } + + /// + /// Represents how much time into the game the event occurred. + /// + [JsonProperty("timestamp")] + [JsonConverter(typeof(TimeSpanConverterFromMilliseconds))] + public TimeSpan Timestamp { get; set; } + + /// + /// The tower type of the event. Only present if relevant. + /// + [JsonProperty("towerType")] + public TowerType? TowerType { get; set; } + + /// + /// The victim ID of the event. Only present if relevant. + /// + [JsonProperty("victimId")] + public int VictimId { get; set; } + + /// + /// The ward type of the event. Only present if relevant. + /// + [JsonProperty("wardType")] + public WardType? WardType { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/MatchFrame.cs b/RiotSharp/Endpoints/TournamentEndpoint/MatchFrame.cs new file mode 100644 index 00000000..c6aa0a9b --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/MatchFrame.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; +using RiotSharp.Misc.Converters; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Class representing a frame in a match (Match API). + /// + public class MatchFrame + { + internal MatchFrame() { } + + /// + /// List of events for this frame. + /// + [JsonProperty("events")] + public List Events { get; set; } + + /// + /// Map of each participant ID to the participant's information for the frame. + /// + [JsonProperty("participantFrames")] + public Dictionary ParticipantFrames { get; set; } + + /// + /// Represents how much time into the game the frame occurred. + /// + [JsonProperty("timestamp")] + [JsonConverter(typeof(TimeSpanConverterFromMilliseconds))] + public TimeSpan Timestamp { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/MatchSummary.cs b/RiotSharp/Endpoints/TournamentEndpoint/MatchSummary.cs new file mode 100644 index 00000000..43c5f43c --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/MatchSummary.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; +using RiotSharp.Endpoints.MatchEndpoint.Enums; +using RiotSharp.Misc; +using RiotSharp.Misc.Converters; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Summary of a match (Match API). + /// + public class MatchSummary + { + internal MatchSummary() { } + + /// + /// Map type. + /// + [JsonProperty("mapId")] + public MapType MapType { get; set; } + + /// + /// Match creation time. Designates when the team select lobby is created and/or the match is made through + /// match making, not when the game actually starts. + /// + [JsonProperty("matchCreation")] + [JsonConverter(typeof(DateTimeConverterFromLong))] + public DateTime MatchCreation { get; set; } + + /// + /// Match duration. + /// + [JsonProperty("matchDuration")] + [JsonConverter(typeof(TimeSpanConverterFromSeconds))] + public TimeSpan MatchDuration { get; set; } + + /// + /// Match ID. + /// + [JsonProperty("matchId")] + public long MatchId { get; set; } + + /// + /// Match mode. + /// + [JsonProperty("matchMode")] + public string MatchMode { get; set; } + + /// + /// Defines what GameType the match is eg. Custom, Matched, Tutorial. + /// + [JsonProperty("matchType")] + public GameType MatchType { get; set; } + + /// + /// Match version. + /// + [JsonProperty("matchVersion")] + public string MatchVersion { get; set; } + + /// + /// Participants identity information. + /// + [JsonProperty("participantIdentities")] + public List ParticipantIdentities { get; set; } + + /// + /// Participants information + /// + [JsonProperty("participants")] + public List Participants { get; set; } + + /// + /// Match queue type. + /// + [JsonProperty("queueType")] + public string QueueType { get; set; } + + /// + /// Region where the match was played. + /// + [JsonProperty("region")] + public Region Region { get; set; } + + /// + /// Season match was played. + /// + [JsonProperty("season")] + public Season Season { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/MatchTimeline.cs b/RiotSharp/Endpoints/TournamentEndpoint/MatchTimeline.cs new file mode 100644 index 00000000..742c83c8 --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/MatchTimeline.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; +using RiotSharp.Misc.Converters; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Class representing a match's timeline (Match API). + /// + public class MatchTimeline + { + internal MatchTimeline() { } + + /// + /// Time between each returned frame. + /// + [JsonProperty("frameInterval")] + [JsonConverter(typeof(TimeSpanConverterFromMilliseconds))] + public TimeSpan FrameInterval { get; set; } + + /// + /// List of timeline frames for the game. + /// + [JsonProperty("frames")] + public List Frames { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/Participant.cs b/RiotSharp/Endpoints/TournamentEndpoint/Participant.cs new file mode 100644 index 00000000..72250b30 --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/Participant.cs @@ -0,0 +1,74 @@ +using System.Collections.Generic; +using Newtonsoft.Json; +using RiotSharp.Endpoints.LeagueEndpoint.Enums; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Class representing a participant in a match (Match API). + /// + public class Participant + { + internal Participant() { } + + /// + /// Champion ID. + /// + [JsonProperty("championId")] + public int ChampionId { get; set; } + + /// + /// List of mastery information. + /// + [JsonProperty("masteries")] + public List Masteries { get; set; } + + /// + /// Participant ID. + /// + [JsonProperty("participantId")] + public int ParticipantId { get; set; } + + /// + /// List of rune information. + /// + [JsonProperty("runes")] + public List Runes { get; set; } + + /// + /// First summoner spell ID. + /// + [JsonProperty("spell1Id")] + public int Spell1Id { get; set; } + + /// + /// Second summoner spell ID. + /// + [JsonProperty("spell2Id")] + public int Spell2Id { get; set; } + + /// + /// Participant statistics. + /// + [JsonProperty("stats")] + public ParticipantStats Stats { get; set; } + + /// + /// Team ID. + /// + [JsonProperty("teamId")] + public int TeamId { get; set; } + + /// + /// Timeline data. + /// + [JsonProperty("timeline")] + public ParticipantTimeline Timeline { get; set; } + + /// + /// Highest achieved season tier. + /// + [JsonProperty("highestAchievedSeasonTier")] + public Tier HighestAchievedSeasonTier { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/ParticipantFrame.cs b/RiotSharp/Endpoints/TournamentEndpoint/ParticipantFrame.cs new file mode 100644 index 00000000..5bf7431f --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/ParticipantFrame.cs @@ -0,0 +1,60 @@ +using Newtonsoft.Json; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Class representing a particular frame for a participant during a match (Match API). + /// + public class ParticipantFrame + { + internal ParticipantFrame() { } + + /// + /// Participant's current gold. + /// + [JsonProperty("currentGold")] + public int CurrentGold { get; set; } + + /// + /// Number of jungle minions killed by participant. + /// + [JsonProperty("jungleMinionsKilled")] + public int JungleMinionsKilled { get; set; } + + /// + /// Participant's current level. + /// + [JsonProperty("level")] + public int Level { get; set; } + + /// + /// Number of minions killed by participant. + /// + [JsonProperty("minionsKilled")] + public int MinionsKilled { get; set; } + + /// + /// Participant ID. + /// + [JsonProperty("participantId")] + public int ParticipantId { get; set; } + + /// + /// Participant's position. + /// + [JsonProperty("position")] + public Position Position { get; set; } + + /// + /// Participant's total gold. + /// + [JsonProperty("totalGold")] + public int TotalGold { get; set; } + + /// + /// Experience earned by participant. + /// + [JsonProperty("xp")] + public int XP { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/ParticipantIdentity.cs b/RiotSharp/Endpoints/TournamentEndpoint/ParticipantIdentity.cs new file mode 100644 index 00000000..2d65b442 --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/ParticipantIdentity.cs @@ -0,0 +1,24 @@ +using Newtonsoft.Json; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Class representing a participant's identity in a match (Match API). + /// + public class ParticipantIdentity + { + internal ParticipantIdentity() { } + + /// + /// Participant ID. + /// + [JsonProperty("participantId")] + public int ParticipantId { get; set; } + + /// + /// Player information. + /// + [JsonProperty("player")] + public Player Player { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/ParticipantStats.cs b/RiotSharp/Endpoints/TournamentEndpoint/ParticipantStats.cs new file mode 100644 index 00000000..38cb7518 --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/ParticipantStats.cs @@ -0,0 +1,538 @@ +using Newtonsoft.Json; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Class gathering statistics about a participant (Match API). + /// + public class ParticipantStats + { + internal ParticipantStats() { } + + /// + /// Number of assists. + /// + [JsonProperty("assists")] + public long Assists { get; set; } + + /// + /// Champion level achieved. + /// + [JsonProperty("champLevel")] + public long ChampLevel { get; set; } + + /// + /// If game was a dominion game, player's combat score, otherwise 0. + /// + [JsonProperty("combatPlayerScore")] + public long CombatPlayerScore { get; set; } + + /// + /// Number of deaths. + /// + [JsonProperty("deaths")] + public long Deaths { get; set; } + + /// + /// Number of double kills. + /// + [JsonProperty("doubleKills")] + public long DoubleKills { get; set; } + + /// + /// Flag indicating if participant got an assist on first blood. + /// + [JsonProperty("firstBloodAssist")] + public bool FirstBloodAssist { get; set; } + + /// + /// Flag indicating if participant got first blood. + /// + [JsonProperty("firstBloodKill")] + public bool FirstBloodKill { get; set; } + + /// + /// Flag indicating if participant got an assist on the first inhibitor. + /// + [JsonProperty("firstInhibitorAssist")] + public bool FirstInhibitorAssist { get; set; } + + /// + /// Flag indicating if participant destroyed the first inhibitor. + /// + [JsonProperty("firstInhibitorKill")] + public bool FirstInhibitorKill { get; set; } + + /// + /// Flag indicating if participant got an assist on the first tower. + /// + [JsonProperty("firstTowerAssist")] + public bool FirstTowerAssist { get; set; } + + /// + /// Flag indicating if participant destroyed the first tower. + /// + [JsonProperty("firstTowerKill")] + public bool FirstTowerKill { get; set; } + + /// + /// Gold earned. + /// + [JsonProperty("goldEarned")] + public long GoldEarned { get; set; } + + /// + /// Gold spent. + /// + [JsonProperty("goldSpent")] + public long GoldSpent { get; set; } + + /// + /// Numer of inhibitor kills. + /// + [JsonProperty("inhibitorKills")] + public long InhibitorKills { get; set; } + + /// + /// First item ID. + /// + [JsonProperty("item0")] + public long Item0 { get; set; } + + /// + /// Second item ID. + /// + [JsonProperty("item1")] + public long Item1 { get; set; } + + /// + /// Third item ID. + /// + [JsonProperty("item2")] + public long Item2 { get; set; } + + /// + /// Fourth item ID. + /// + [JsonProperty("item3")] + public long Item3 { get; set; } + + /// + /// Fifth item ID. + /// + [JsonProperty("item4")] + public long Item4 { get; set; } + + /// + /// Sixth item ID. + /// + [JsonProperty("item5")] + public long Item5 { get; set; } + + /// + /// Seventh item ID. + /// + [JsonProperty("item6")] + public long Item6 { get; set; } + + /// + /// Number of killing sprees. + /// + [JsonProperty("killingSprees")] + public long KillingSprees { get; set; } + + /// + /// Number of kills. + /// + [JsonProperty("kills")] + public long Kills { get; set; } + + /// + /// Largest critical strike. + /// + [JsonProperty("largestCriticalStrike")] + public long LargestCriticalStrike { get; set; } + + /// + /// Largest killing spree. + /// + [JsonProperty("largestKillingSpree")] + public long LargestKillingSpree { get; set; } + + /// + /// Largest multi kill. + /// + [JsonProperty("largestMultiKill")] + public long LargestMultiKill { get; set; } + + /// + /// Magic damage dealt. + /// + [JsonProperty("magicDamageDealt")] + public long MagicDamageDealt { get; set; } + + /// + /// Magic damage dealt to champions. + /// + [JsonProperty("magicDamageDealtToChampions")] + public long MagicDamageDealtToChampions { get; set; } + + /// + /// Magic damage taken. + /// + [JsonProperty("magicDamageTaken")] + public long MagicDamageTaken { get; set; } + + /// + /// Minions kiled. + /// + [JsonProperty("totalMinionsKilled")] + public long TotalMinionsKilled { get; set; } + + /// + /// Neutral minions killed. + /// + [JsonProperty("neutralMinionsKilled")] + public long NeutralMinionsKilled { get; set; } + + /// + /// Neutral jungle minions killed in the enemy team's jungle. + /// + [JsonProperty("neutralMinionsKilledEnemyJungle")] + public long NeutralMinionsKilledEnemyJungle { get; set; } + + /// + /// Neutral jungle minions killed in your team's jungle. + /// + [JsonProperty("neutralMinionsKilledTeamJungle")] + public long NeutralMinionsKilledJungle { get; set; } + + /// + /// If game was a dominion game, number of node captures. + /// + [JsonProperty("nodeCapture")] + public long NodeCapture { get; set; } + + /// + /// If game was a dominion game, number of node capture assists. + /// + [JsonProperty("nodeCaptureAssist")] + public long NodeCaptureAssist { get; set; } + + /// + /// If game was a dominion game, number of node neutralizations. + /// + [JsonProperty("nodeNeutralize")] + public long NodeNeutralize { get; set; } + + /// + /// If game was a dominion game, number of node neutralization assists. + /// + [JsonProperty("nodeNeutralizeAssist")] + public long NodeNeutralizeAssist { get; set; } + + /// + /// If game was a dominion game, player's objectives score, otherwise 0. + /// + [JsonProperty("objectivePlayerScore")] + public long ObjectivePlayerScore { get; set; } + + /// + /// Number of penta kills. + /// + [JsonProperty("pentaKills")] + public long PentaKills { get; set; } + + /// + /// Physical damage dealt. + /// + [JsonProperty("physicalDamageDealt")] + public long PhysicalDamageDealt { get; set; } + + /// + /// Physical damage dealt to champions. + /// + [JsonProperty("physicalDamageDealtToChampions")] + public long PhysicalDamageDealtToChampions { get; set; } + + /// + /// Physical damage taken. + /// + [JsonProperty("physicalDamageTaken")] + public long PhysicalDamageTaken { get; set; } + + /// + /// Number of quadra kills. + /// + [JsonProperty("quadraKills")] + public long QuadraKills { get; set; } + + /// + /// Number of sight wards purchased. + /// + [JsonProperty("sightWardsBoughtInGame")] + public long SightWardsBoughtInGame { get; set; } + + /// + /// If game was a dominion game, number of completed team objectives (i.e., quests). + /// + [JsonProperty("teamObjective")] + public long TeamObjective { get; set; } + + /// + /// Total damage dealt. + /// + [JsonProperty("totalDamageDealt")] + public long TotalDamageDealt { get; set; } + + /// + /// Total damage dealt to champions. + /// + [JsonProperty("totalDamageDealtToChampions")] + public long TotalDamageDealtToChampions { get; set; } + + /// + /// Total damage taken. + /// + [JsonProperty("totalDamageTaken")] + public long TotalDamageTaken { get; set; } + + /// + /// Total heal. + /// + [JsonProperty("totalHeal")] + public long TotalHeal { get; set; } + + /// + /// If game was a dominion game, player's total score, otherwise 0. + /// + [JsonProperty("totalPlayerScore")] + public long TotalPlayerScore { get; set; } + + /// + /// If game was a dominion game, team rank of the player's total score (e.g., 1-5). + /// + [JsonProperty("totalScoreRank")] + public long TotalScoreRank { get; set; } + + /// + /// Total time crowd control dealt. + /// + [JsonProperty("totalTimeCrowdControlDealt")] + public long TotalTimeCrowdControlDealt { get; set; } + + /// + /// Total units healed. + /// + [JsonProperty("totalUnitsHealed")] + public long TotalUnitsHealed { get; set; } + + /// + /// Number of tower kills. + /// + [JsonProperty("towerKills")] + public long TowerKills { get; set; } + + /// + /// Number of triple kills. + /// + [JsonProperty("tripleKills")] + public long TripleKills { get; set; } + + /// + /// True damage dealt. + /// + [JsonProperty("trueDamageDealt")] + public long TrueDamageDealt { get; set; } + + /// + /// True damage dealt to champions. + /// + [JsonProperty("trueDamageDealtToChampions")] + public long TrueDamageDealtToChampions { get; set; } + + /// + /// True damage taken. + /// + [JsonProperty("trueDamageTaken")] + public long TrueDamageTaken { get; set; } + + /// + /// Number of unreal kills. + /// + [JsonProperty("unrealKills")] + public long UnrealKills { get; set; } + + /// + /// Vision score. + /// + [JsonProperty("visionScore")] + public long VisionScore { get; set; } + + /// + /// Number of vision wards purchased. + /// + [JsonProperty("visionWardsBoughtInGame")] + public long VisionWardsBoughtInGame { get; set; } + + /// + /// Number of wards killed. + /// + [JsonProperty("wardsKilled")] + public long WardsKilled { get; set; } + + /// + /// Number of wards placed. + /// + [JsonProperty("wardsPlaced")] + public long WardsPlaced { get; set; } + + /// + /// Flag indicating whether or not the participant won. + /// + [JsonProperty("win")] + public bool Winner { get; set; } + + #region Perk Stats + /// + /// Primary rune path. + /// + [JsonProperty("perkPrimaryStyle")] + public int PerkPrimaryStyle { get; set; } + /// + /// Secondary rune path. + /// + [JsonProperty("perkSubStyle")] + public int PerkSubStyle { get; set; } + + /// + /// Primary path keystone rune. + /// + [JsonProperty("perk0")] + public int Perk0 { get; set; } + /// + /// Primary path rune. + /// + [JsonProperty("perk1")] + public int Perk1 { get; set; } + /// + /// Primary path rune. + /// + [JsonProperty("perk2")] + public int Perk2 { get; set; } + /// + /// Primary path rune. + /// + [JsonProperty("perk3")] + public int Perk3 { get; set; } + /// + /// Secondary path rune. + /// + [JsonProperty("perk4")] + public int Perk4 { get; set; } + /// + /// Secondary path rune. + /// + [JsonProperty("perk5")] + public int Perk5 { get; set; } + + /// + /// Post game rune stat of Perk1. + /// + [JsonProperty("perk1Var1")] + public int Perk1Var1 { get; set; } + /// + /// Post game rune stat of Perk1. + /// + [JsonProperty("perk1Var2")] + public int Perk1Var2 { get; set; } + /// + /// Post game rune stat of Perk1. + /// + [JsonProperty("perk1Var3")] + public int Perk1Var3 { get; set; } + + /// + /// Post game rune stat of Perk2. + /// + [JsonProperty("perk2Var1")] + public int Perk2Var1 { get; set; } + /// + /// Post game rune stat of Perk2. + /// + [JsonProperty("perk2Var2")] + public int Perk2Var2 { get; set; } + /// + /// Post game rune stat of Perk2. + /// + [JsonProperty("perk2Var3")] + public int Perk2Var3 { get; set; } + + /// + /// Post game rune stat of Perk3. + /// + [JsonProperty("perk3Var1")] + public int Perk3Var1 { get; set; } + /// + /// Post game rune stat of Perk3. + /// + [JsonProperty("perk3Var2")] + public int Perk3Var2 { get; set; } + /// + /// Post game rune stat of Perk3. + /// + [JsonProperty("perk3Var3")] + public int Perk3Var3 { get; set; } + + /// + /// Post game rune stat of Perk4. + /// + [JsonProperty("perk4Var1")] + public int Perk4Var1 { get; set; } + /// + /// Post game rune stat of Perk4. + /// + [JsonProperty("perk4Var2")] + public int Perk4Var2 { get; set; } + /// + /// Post game rune stat of Perk4. + /// + [JsonProperty("perk4Var3")] + public int Perk4Var3 { get; set; } + + /// + /// Post game rune stat of Perk5. + /// + [JsonProperty("perk5Var1")] + public int Perk5Var1 { get; set; } + /// + /// Post game rune stat of Perk5. + /// + [JsonProperty("perk5Var2")] + public int Perk5Var2 { get; set; } + /// + /// Post game rune stat of Perk5. + /// + [JsonProperty("perk5Var3")] + public int Perk5Var3 { get; set; } + + /// + /// Rune stat + /// + [JsonProperty("statPerk0")] + public int StatPerk0 { get; set; } + + /// + /// Rune stat + /// + [JsonProperty("statPerk1")] + public int StatPerk1 { get; set; } + + /// + /// Rune stat + /// + [JsonProperty("statPerk2")] + public int StatPerk2 { get; set; } + #endregion + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/ParticipantTimeline.cs b/RiotSharp/Endpoints/TournamentEndpoint/ParticipantTimeline.cs new file mode 100644 index 00000000..93014446 --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/ParticipantTimeline.cs @@ -0,0 +1,71 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// The timeline of a participant in a match + /// + public class ParticipantTimeline + { + /// + /// The lane of the participant. + /// + [JsonProperty("lane")] + public string Lane { get; set; } + + /// + /// The role of the participant. + /// + [JsonProperty("role")] + public string Role { get; set; } + + /// + /// The participant ID. + /// + [JsonProperty("participantId")] + public int ParticipantId { get; set; } + + /// + /// Gold for a specified period. + /// + [JsonProperty("goldPerMinDeltas")] + public Dictionary GoldPerMinDeltas { get; set; } + + /// + /// Experience difference versus the calculated lane opponent(s) for a specified period. + /// + [JsonProperty("xpDiffPerMinDeltas")] + public Dictionary XpDiffPerMinDeltas { get; set; } + + /// + /// Experience change for a specified period. + /// + [JsonProperty("xpPerMinDeltas")] + public Dictionary XpPerMinDeltas { get; set; } + + /// + /// Creep score difference versus the calculated lane opponent(s) for a specified period. + /// + [JsonProperty("csDiffPerMinDeltas")] + public Dictionary CsDiffPerMinDeltas { get; set; } + + /// + /// Creeps for a specified period. + /// + [JsonProperty("creepsPerMinDeltas")] + public Dictionary CreepsPerMinDeltas { get; set; } + + /// + /// Damage taken difference versus the calculated lane opponent(s) for a specified period. + /// + [JsonProperty("damageTakenDiffPerMinDeltas")] + public Dictionary DamageTakenDiffPerMinDeltas { get; set; } + + /// + /// Damage taken for a specified period. + /// + [JsonProperty("damageTakenPerMinDeltas")] + public Dictionary DamageTakenPerMinDeltas { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/Player.cs b/RiotSharp/Endpoints/TournamentEndpoint/Player.cs new file mode 100644 index 00000000..c732c82e --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/Player.cs @@ -0,0 +1,61 @@ +using Newtonsoft.Json; +using RiotSharp.Misc; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Player in a match (Match API). + /// + public class Player + { + internal Player() { } + + /// + /// Current platform ID. + /// + [JsonProperty("currentPlatformId")] + public Platform CurrentPlatformId { get; set; } + + /// + /// Platform ID. + /// + [JsonProperty("platformId")] + public Platform PlatformId { get; set; } + + /// + /// Match history URI. + /// + [JsonProperty("matchHistoryUri")] + public string MatchHistoryUri { get; set; } + + /// + /// Profile icon ID. + /// + [JsonProperty("profileIcon")] + public int ProfileIcon { get; set; } + + /// + /// Current account ID. + /// + [JsonProperty("currentAccountId")] + public string CurrentAccountId { get; set; } + + /// + /// Account ID. + /// + [JsonProperty("accountId")] + public string AccountId { get; set; } + + /// + /// Summoner ID. + /// + [JsonProperty("summonerId")] + public string SummonerId { get; set; } + + /// + /// Summoner name. + /// + [JsonProperty("summonerName")] + public string SummonerName { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/Position.cs b/RiotSharp/Endpoints/TournamentEndpoint/Position.cs new file mode 100644 index 00000000..1bdb86ff --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/Position.cs @@ -0,0 +1,24 @@ +using Newtonsoft.Json; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Participant's position (Match API). + /// + public class Position + { + internal Position() { } + + /// + /// Participant's X coordinate. + /// + [JsonProperty("x")] + public int X { get; set; } + + /// + /// Participant's Y coordinate. + /// + [JsonProperty("y")] + public int Y { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/Rune.cs b/RiotSharp/Endpoints/TournamentEndpoint/Rune.cs new file mode 100644 index 00000000..7094e986 --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/Rune.cs @@ -0,0 +1,24 @@ +using Newtonsoft.Json; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Class representing a rune of a participant (Match API). + /// + public class Rune + { + internal Rune() { } + + /// + /// Rune rank. + /// + [JsonProperty("rank")] + public int Rank { get; set; } + + /// + /// Rune ID. + /// + [JsonProperty("runeId")] + public int RuneId { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/TeamBan.cs b/RiotSharp/Endpoints/TournamentEndpoint/TeamBan.cs new file mode 100644 index 00000000..e8d6037e --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/TeamBan.cs @@ -0,0 +1,23 @@ +using Newtonsoft.Json; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// A ban + /// + public class TeamBan + { + internal TeamBan() { } + + /// + /// The pick turn where the champion has been banned. + /// + [JsonProperty("pickTurn")] + public int PickTurn { get; set; } + /// + /// ID of the banned champion. + /// + [JsonProperty("championId")] + public int ChampionId { get; set; } + } +} diff --git a/RiotSharp/Endpoints/TournamentEndpoint/TeamStats.cs b/RiotSharp/Endpoints/TournamentEndpoint/TeamStats.cs new file mode 100644 index 00000000..d3f451f7 --- /dev/null +++ b/RiotSharp/Endpoints/TournamentEndpoint/TeamStats.cs @@ -0,0 +1,109 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace RiotSharp.Endpoints.TournamentEndpoint +{ + /// + /// Class representing a team in a match (Match API). + /// + public class TeamStats + { + internal TeamStats() { } + + /// + /// If game was draft mode, contains banned champion data, otherwise null. + /// + [JsonProperty("bans")] + public List Bans { get; set; } + + /// + /// Number of times the team killed baron. + /// + [JsonProperty("baronKills")] + public int BaronKills { get; set; } + + /// + /// If game was a dominion game, specifies the points the team had at game end, otherwise null. + /// + [JsonProperty("dominionVictoryScore")] + public long DominionVictoryScore { get; set; } + + /// + /// Number of times the team killed dragon. + /// + [JsonProperty("dragonKills")] + public int DragonKills { get; set; } + + /// + /// Flag indicating whether or not the team got the first baron kill. + /// + [JsonProperty("firstBaron")] + public bool FirstBaron { get; set; } + + /// + /// Flag indicating whether or not the team got first blood. + /// + [JsonProperty("firstBlood")] + public bool FirstBlood { get; set; } + + /// + /// Flag indicating whether or not the team got the first dragon kill. + /// + [JsonProperty("firstDragon")] + public bool FirstDragon { get; set; } + + /// + /// Flag indicating whether or not the team destroyed the first inhibitor. + /// + [JsonProperty("firstInhibitor")] + public bool FirstInhibitor { get; set; } + + /// + /// Flag indicating whether or not the team killed the first rift herald. + /// + [JsonProperty("firstRiftHerald")] + public bool FirstRiftHerald { get; set; } + + /// + /// Flag indicating whether or not the team destroyed the first tower. + /// + [JsonProperty("firstTower")] + public bool FirstTower { get; set; } + + /// + /// Number of inhibitors the team destroyed. + /// + [JsonProperty("inhibitorKills")] + public int InhibitorKills { get; set; } + + /// + /// Number of rift heralds killed. + /// + [JsonProperty("riftHeraldKills")] + public int RiftHeraldKills { get; set; } + + /// + /// Team ID. + /// + [JsonProperty("teamId")] + public int TeamId { get; set; } + + /// + /// Number of towers the team destroyed. + /// + [JsonProperty("towerKills")] + public int TowerKills { get; set; } + + /// + /// Number of times the team killed vilemaw (Twisted Treeline epic monster). + /// + [JsonProperty("vilemawKills")] + public int VilemawKills { get; set; } + + /// + /// A string indicating whether or not the team won. + /// + [JsonProperty("win")] + public string Win { get; set; } + } +} diff --git a/RiotSharp/Interfaces/ITournamentRiotApi.cs b/RiotSharp/Interfaces/ITournamentRiotApi.cs index a69198b7..42508bcd 100644 --- a/RiotSharp/Interfaces/ITournamentRiotApi.cs +++ b/RiotSharp/Interfaces/ITournamentRiotApi.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Threading.Tasks; -using RiotSharp.Endpoints.MatchEndpoint; using RiotSharp.Endpoints.TournamentEndpoint; using RiotSharp.Endpoints.TournamentEndpoint.Enums; using RiotSharp.Misc; diff --git a/RiotSharp/TournamentRiotApi.cs b/RiotSharp/TournamentRiotApi.cs index e32b025a..f0d55e31 100644 --- a/RiotSharp/TournamentRiotApi.cs +++ b/RiotSharp/TournamentRiotApi.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using RiotSharp.Endpoints.MatchEndpoint; using RiotSharp.Endpoints.TournamentEndpoint; using RiotSharp.Endpoints.TournamentEndpoint.Enums; using RiotSharp.Misc; From ca7807ff97a66cea2178409626adb591c3f4c5ae Mon Sep 17 00:00:00 2001 From: Tom Eckstein Date: Wed, 19 May 2021 11:54:16 +0200 Subject: [PATCH 4/8] Add timeline MatchV5 Support --- .../Endpoints/MatchEndpoint/ChampionStats.cs | 111 ++++++++++++++++++ .../Endpoints/MatchEndpoint/DamageStats.cs | 61 ++++++++++ .../MatchEndpoint/Enums/MatchEventType.cs | 8 ++ .../Endpoints/MatchEndpoint/MatchEvent.cs | 43 +++++++ .../MatchEndpoint/ParticipantFrame.cs | 27 +++++ .../Endpoints/MatchEndpoint/VictimDamage.cs | 42 +++++++ 6 files changed, 292 insertions(+) create mode 100644 RiotSharp/Endpoints/MatchEndpoint/ChampionStats.cs create mode 100644 RiotSharp/Endpoints/MatchEndpoint/DamageStats.cs create mode 100644 RiotSharp/Endpoints/MatchEndpoint/VictimDamage.cs diff --git a/RiotSharp/Endpoints/MatchEndpoint/ChampionStats.cs b/RiotSharp/Endpoints/MatchEndpoint/ChampionStats.cs new file mode 100644 index 00000000..46be4e4c --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/ChampionStats.cs @@ -0,0 +1,111 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + public class ChampionStats + { + internal ChampionStats() { } + + [JsonProperty("abilityHaste")] + public int AbilityHaste { get; set; } + + + [JsonProperty("abilityPower")] + public int AbilityPower { get; set; } + + + [JsonProperty("armor")] + public int Armor { get; set; } + + + [JsonProperty("armorPen")] + public int ArmorPen { get; set; } + + + [JsonProperty("armorPenPercent")] + public int ArmorPenPercent { get; set; } + + + [JsonProperty("attackDamage")] + public int AttackDamage { get; set; } + + + [JsonProperty("attackSpeed")] + public int AttackSpeed { get; set; } + + + [JsonProperty("bonusArmorPenPercent")] + public int BonusArmorPenPercent { get; set; } + + + [JsonProperty("bonusMagicPenPercent")] + public int BonusMagicPenPercent { get; set; } + + + [JsonProperty("ccReduction")] + public int CcReduction { get; set; } + + + [JsonProperty("cooldownReduction")] + public int CooldownReduction { get; set; } + + + [JsonProperty("health")] + public int Health { get; set; } + + + [JsonProperty("healthMax")] + public int HealthMax { get; set; } + + + [JsonProperty("healthRegen")] + public int HealthRegen { get; set; } + + + [JsonProperty("lifesteal")] + public int Lifesteal { get; set; } + + + [JsonProperty("magicPen")] + public int MagicPen { get; set; } + + + [JsonProperty("magicPenPercent")] + public int MagicPenPercent { get; set; } + + + [JsonProperty("magicResist")] + public int MagicResist { get; set; } + + + [JsonProperty("movementSpeed")] + public int MovementSpeed { get; set; } + + + [JsonProperty("omnivamp")] + public int Omnivamp { get; set; } + + + [JsonProperty("physicalVamp")] + public int PhysicalVamp { get; set; } + + + [JsonProperty("power")] + public int Power { get; set; } + + + [JsonProperty("powerMax")] + public int PowerMax { get; set; } + + + [JsonProperty("powerRegen")] + public int PowerRegen { get; set; } + + + [JsonProperty("spellVamp")] + public int SpellVamp { get; set; } + } +} diff --git a/RiotSharp/Endpoints/MatchEndpoint/DamageStats.cs b/RiotSharp/Endpoints/MatchEndpoint/DamageStats.cs new file mode 100644 index 00000000..0cdf7e34 --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/DamageStats.cs @@ -0,0 +1,61 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + public class DamageStats + { + internal DamageStats() { } + + + [JsonProperty("magicDamageDone")] + public int MagicDamageDone { get; set; } + + + [JsonProperty("magicDamageDoneToChampions")] + public int MagicDamageDoneToChampions { get; set; } + + + [JsonProperty("magicDamageTaken")] + public int MagicDamageTaken { get; set; } + + + [JsonProperty("physicalDamageDone")] + public int PhysicalDamageDone { get; set; } + + + [JsonProperty("physicalDamageDoneToChampions")] + public int PhysicalDamageDoneToChampions { get; set; } + + + [JsonProperty("physicalDamageTaken")] + public int PhysicalDamageTaken { get; set; } + + + [JsonProperty("totalDamageDone")] + public int TotalDamageDone { get; set; } + + + [JsonProperty("totalDamageDoneToChampions")] + public int TotalDamageDoneToChampions { get; set; } + + + [JsonProperty("totalDamageTaken")] + public int TotalDamageTaken { get; set; } + + + [JsonProperty("trueDamageDone")] + public int TrueDamageDone { get; set; } + + + [JsonProperty("trueDamageDoneToChampions")] + public int TrueDamageDoneToChampions { get; set; } + + + [JsonProperty("trueDamageTaken")] + public int TrueDamageTaken { get; set; } + + } +} diff --git a/RiotSharp/Endpoints/MatchEndpoint/Enums/MatchEventType.cs b/RiotSharp/Endpoints/MatchEndpoint/Enums/MatchEventType.cs index ce5f2596..7c54cad2 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/Enums/MatchEventType.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/Enums/MatchEventType.cs @@ -54,6 +54,14 @@ public enum MatchEventType /// ItemUndo, + /// + /// Triggers on champion level up. + /// + LevelUp, + + /// + /// Triggers on start of the game + /// PauseEnd, /// diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchEvent.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchEvent.cs index 1c7ed80c..b1c08f5d 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/MatchEvent.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/MatchEvent.cs @@ -32,6 +32,12 @@ internal MatchEvent() { } [JsonProperty("buildingType")] public BuildingType? BuildingType { get; set; } + /// + /// Amount of bounty recieved by the killer. Only present if relevant. + /// + [JsonProperty("bounty")] + public int Bounty { get; set; } + /// /// The creator ID of the event. Only present if relevant. /// @@ -68,12 +74,30 @@ internal MatchEvent() { } [JsonProperty("killerId")] public int KillerId { get; set; } + /// + /// Amount of kills in a kill streak. Only present if relevant. + /// + [JsonProperty("killStreakLength")] + public int KillStreakLength { get; set; } + + /// + /// The killer team ID of the event. Only present if relevant. + /// + [JsonProperty("killerTeamId")] + public int KillerTeamId { get; set; } + /// /// The lane type of the event. Only present if relevant. /// [JsonProperty("laneType")] public LaneType? LaneType { get; set; } + /// + /// The level up type of the event. Only present if relevant. + /// + [JsonProperty("level")] + public int Level{ get; set; } + /// /// The level up type of the event. Only present if relevant. /// @@ -110,6 +134,13 @@ internal MatchEvent() { } [JsonProperty("position")] public Position Position { get; set; } + /// + /// Timestamp in the real world. Only present for game start. + /// + [JsonProperty("realTimestamp")] + [JsonConverter(typeof(DateTimeConverterFromLong))] + public DateTime RealTimestamp { get; set; } + /// /// The skill slot of the event. Only present if relevant. /// @@ -141,6 +172,18 @@ internal MatchEvent() { } [JsonProperty("victimId")] public int VictimId { get; set; } + /// + /// List of Damage Instances dealt by the victim. Only present if relevant. + /// + [JsonProperty("victimDamageDealt")] + public List VictimDamageDealt { get; set; } + + /// + /// List of Damage Instances received by the victim. Only present if relevant. + /// + [JsonProperty("victimDamageReceived")] + public List VictimDamageReceived { get; set; } + /// /// The ward type of the event. Only present if relevant. /// diff --git a/RiotSharp/Endpoints/MatchEndpoint/ParticipantFrame.cs b/RiotSharp/Endpoints/MatchEndpoint/ParticipantFrame.cs index 7dab4ae6..ac203fdd 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/ParticipantFrame.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/ParticipantFrame.cs @@ -1,4 +1,6 @@ using Newtonsoft.Json; +using RiotSharp.Misc.Converters; +using System; namespace RiotSharp.Endpoints.MatchEndpoint { @@ -9,12 +11,30 @@ public class ParticipantFrame { internal ParticipantFrame() { } + /// + /// Participant's champion stats. + /// + [JsonProperty("championStats")] + public ChampionStats ChampionStats { get; set; } + /// /// Participant's current gold. /// [JsonProperty("currentGold")] public int CurrentGold { get; set; } + /// + /// Participant's damage stats. + /// + [JsonProperty("damageStats")] + public DamageStats DamageStats { get; set; } + + /// + /// Participant's gold per second. + /// + [JsonProperty("goldPerSecond")] + public int GoldPerSecond { get; set; } + /// /// Number of jungle minions killed by participant. /// @@ -45,6 +65,13 @@ internal ParticipantFrame() { } [JsonProperty("position")] public Position Position { get; set; } + /// + /// Participant's total gold. + /// + [JsonProperty("timeEnemySpentControlled")] + [JsonConverter(typeof(TimeSpanConverterFromMilliseconds))] + public TimeSpan TimeEnemySpentControlled { get; set; } + /// /// Participant's total gold. /// diff --git a/RiotSharp/Endpoints/MatchEndpoint/VictimDamage.cs b/RiotSharp/Endpoints/MatchEndpoint/VictimDamage.cs new file mode 100644 index 00000000..cfdaaa60 --- /dev/null +++ b/RiotSharp/Endpoints/MatchEndpoint/VictimDamage.cs @@ -0,0 +1,42 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace RiotSharp.Endpoints.MatchEndpoint +{ + /// + /// Class representing one instance of damage recieved or dealt by a victim. + /// + public class VictimDamage + { + internal VictimDamage() { } + + [JsonProperty("basic")] + public bool Basic { get; set; } + + [JsonProperty("magicDamage")] + public int MagicDamage { get; set; } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("participantId")] + public int ParticipantId { get; set; } + + [JsonProperty("physicalDamage")] + public int PhysicalDamage { get; set; } + + [JsonProperty("spellName")] + public string SpellName { get; set; } + + [JsonProperty("spellSlot")] + public int SpellSlot { get; set; } + + [JsonProperty("trueDamage")] + public int TrueDamage { get; set; } + + [JsonProperty("type")] + public string Type { get; set; } + } +} From ef4825e814703722fcc3dedfacf3ed866873bece Mon Sep 17 00:00:00 2001 From: Tom Eckstein Date: Wed, 19 May 2021 12:10:00 +0200 Subject: [PATCH 5/8] Remove outdated Models --- .../Endpoints/MatchEndpoint/BannedChampion.cs | 24 - RiotSharp/Endpoints/MatchEndpoint/Mastery.cs | 24 - .../Endpoints/MatchEndpoint/MatchDetail.cs | 25 - .../Endpoints/MatchEndpoint/MatchList.cs | 35 -- .../Endpoints/MatchEndpoint/MatchReference.cs | 69 --- .../Endpoints/MatchEndpoint/MatchSummary.cs | 92 --- .../MatchEndpoint/ParticipantIdentity.cs | 24 - .../MatchEndpoint/ParticipantStats.cs | 538 ------------------ .../MatchEndpoint/ParticipantTimeline.cs | 71 --- .../MatchEndpoint/ParticipantTimelineData.cs | 36 -- RiotSharp/Endpoints/MatchEndpoint/Player.cs | 61 -- RiotSharp/Endpoints/MatchEndpoint/Rune.cs | 24 - 12 files changed, 1023 deletions(-) delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/BannedChampion.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/Mastery.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/MatchDetail.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/MatchList.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/MatchReference.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/MatchSummary.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/ParticipantIdentity.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/ParticipantStats.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/ParticipantTimeline.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/ParticipantTimelineData.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/Player.cs delete mode 100644 RiotSharp/Endpoints/MatchEndpoint/Rune.cs diff --git a/RiotSharp/Endpoints/MatchEndpoint/BannedChampion.cs b/RiotSharp/Endpoints/MatchEndpoint/BannedChampion.cs deleted file mode 100644 index 4830a8d0..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/BannedChampion.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Newtonsoft.Json; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// Class representing a banned champion (Game API). - /// - public class BannedChampion - { - internal BannedChampion() { } - - /// - /// Banned champion ID. - /// - [JsonProperty("championId")] - public int ChampionId { get; set; } - - /// - /// Turn during which the champion was banned. - /// - [JsonProperty("pickTurn")] - public int PickTurn { get; set; } - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/Mastery.cs b/RiotSharp/Endpoints/MatchEndpoint/Mastery.cs deleted file mode 100644 index 064349a0..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/Mastery.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Newtonsoft.Json; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// Class representing a mastery of a participant (Match API). - /// - public class Mastery - { - internal Mastery() { } - - /// - /// Mastery ID. - /// - [JsonProperty("masteryId")] - public int MasteryId { get; set; } - - /// - /// Mastery rank. - /// - [JsonProperty("rank")] - public int Rank { get; set; } - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchDetail.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchDetail.cs deleted file mode 100644 index 5daae098..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/MatchDetail.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Collections.Generic; -using Newtonsoft.Json; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// Details about a match (Match API). - /// - public class MatchDetail : MatchSummary - { - internal MatchDetail() { } - - /// - /// Team information. - /// - [JsonProperty("teams")] - public List Teams { get; set; } - - /// - /// Match timeline data. Not included by default. - /// - [JsonProperty("timeline")] - public MatchTimeline Timeline { get; set; } - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchList.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchList.cs deleted file mode 100644 index 19a3782d..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/MatchList.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections.Generic; -using Newtonsoft.Json; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// Represents a list of matches - /// - public class MatchList - { - /// - /// The end index of the list of matches. - /// - [JsonProperty("endIndex")] - public int EndIndex { get; set; } - - /// - /// List of matches for the player - /// - [JsonProperty("matches")] - public List Matches { get; set; } - - /// - /// The start index of the list of matches. - /// - [JsonProperty("startIndex")] - public int StartIndex { get; set; } - - /// - /// Total number of games within the list. - /// - [JsonProperty("totalGames")] - public int TotalGames { get; set; } - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchReference.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchReference.cs deleted file mode 100644 index 8a8bd685..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/MatchReference.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using Newtonsoft.Json; -using RiotSharp.Endpoints.MatchEndpoint.Enums; -using RiotSharp.Misc; -using RiotSharp.Misc.Converters; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// A reference to a match - /// - public class MatchReference - { - /// - /// The ID of the champion played during the match. - /// - [JsonProperty("champion")] - public long ChampionID { get; set; } - - /// - /// Participant's lane. - /// - [JsonProperty("lane")] - public Lane Lane { get; set; } - - /// - /// The match ID relating to the match. - /// - [JsonProperty("gameId")] - public long GameId { get; set; } - - /// - /// The ID of the platform on which the game is being played - /// - [JsonProperty("platformId")] - [JsonConverter(typeof(PlatformConverter))] - public Platform PlatformId { get; set; } - - /// - /// Match queue type. - /// - [JsonProperty("queue")] - public int Queue { get; set; } - - /// - /// The region match was played in. - /// - public Region Region { get { return PlatformToRegionConverter.ConvertToRegion(PlatformId); } } - - /// - /// Participant's role. - /// - [JsonProperty("role")] - public Role Role { get; set; } - - /// - /// Season match was played. - /// - [JsonProperty("season")] - public Season Season { get; set; } - - /// - /// The date/time of which the game lobby was created. - /// - [JsonProperty("timestamp")] - [JsonConverter(typeof(DateTimeConverterFromLong))] - public DateTime Timestamp { get; set; } - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchSummary.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchSummary.cs deleted file mode 100644 index cfdd8ba0..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/MatchSummary.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections.Generic; -using Newtonsoft.Json; -using RiotSharp.Endpoints.MatchEndpoint.Enums; -using RiotSharp.Misc; -using RiotSharp.Misc.Converters; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// Summary of a match (Match API). - /// - public class MatchSummary - { - internal MatchSummary() { } - - /// - /// Map type. - /// - [JsonProperty("mapId")] - public MapType MapType { get; set; } - - /// - /// Match creation time. Designates when the team select lobby is created and/or the match is made through - /// match making, not when the game actually starts. - /// - [JsonProperty("matchCreation")] - [JsonConverter(typeof(DateTimeConverterFromLong))] - public DateTime MatchCreation { get; set; } - - /// - /// Match duration. - /// - [JsonProperty("matchDuration")] - [JsonConverter(typeof(TimeSpanConverterFromSeconds))] - public TimeSpan MatchDuration { get; set; } - - /// - /// Match ID. - /// - [JsonProperty("matchId")] - public long MatchId { get; set; } - - /// - /// Match mode. - /// - [JsonProperty("matchMode")] - public string MatchMode { get; set; } - - /// - /// Defines what GameType the match is eg. Custom, Matched, Tutorial. - /// - [JsonProperty("matchType")] - public GameType MatchType { get; set; } - - /// - /// Match version. - /// - [JsonProperty("matchVersion")] - public string MatchVersion { get; set; } - - /// - /// Participants identity information. - /// - [JsonProperty("participantIdentities")] - public List ParticipantIdentities { get; set; } - - /// - /// Participants information - /// - [JsonProperty("participants")] - public List Participants { get; set; } - - /// - /// Match queue type. - /// - [JsonProperty("queueType")] - public string QueueType { get; set; } - - /// - /// Region where the match was played. - /// - [JsonProperty("region")] - public Region Region { get; set; } - - /// - /// Season match was played. - /// - [JsonProperty("season")] - public Season Season { get; set; } - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/ParticipantIdentity.cs b/RiotSharp/Endpoints/MatchEndpoint/ParticipantIdentity.cs deleted file mode 100644 index dc1059a4..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/ParticipantIdentity.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Newtonsoft.Json; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// Class representing a participant's identity in a match (Match API). - /// - public class ParticipantIdentity - { - internal ParticipantIdentity() { } - - /// - /// Participant ID. - /// - [JsonProperty("participantId")] - public int ParticipantId { get; set; } - - /// - /// Player information. - /// - [JsonProperty("player")] - public Player Player { get; set; } - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/ParticipantStats.cs b/RiotSharp/Endpoints/MatchEndpoint/ParticipantStats.cs deleted file mode 100644 index 640ff44b..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/ParticipantStats.cs +++ /dev/null @@ -1,538 +0,0 @@ -using Newtonsoft.Json; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// Class gathering statistics about a participant (Match API). - /// - public class ParticipantStats - { - internal ParticipantStats() { } - - /// - /// Number of assists. - /// - [JsonProperty("assists")] - public long Assists { get; set; } - - /// - /// Champion level achieved. - /// - [JsonProperty("champLevel")] - public long ChampLevel { get; set; } - - /// - /// If game was a dominion game, player's combat score, otherwise 0. - /// - [JsonProperty("combatPlayerScore")] - public long CombatPlayerScore { get; set; } - - /// - /// Number of deaths. - /// - [JsonProperty("deaths")] - public long Deaths { get; set; } - - /// - /// Number of double kills. - /// - [JsonProperty("doubleKills")] - public long DoubleKills { get; set; } - - /// - /// Flag indicating if participant got an assist on first blood. - /// - [JsonProperty("firstBloodAssist")] - public bool FirstBloodAssist { get; set; } - - /// - /// Flag indicating if participant got first blood. - /// - [JsonProperty("firstBloodKill")] - public bool FirstBloodKill { get; set; } - - /// - /// Flag indicating if participant got an assist on the first inhibitor. - /// - [JsonProperty("firstInhibitorAssist")] - public bool FirstInhibitorAssist { get; set; } - - /// - /// Flag indicating if participant destroyed the first inhibitor. - /// - [JsonProperty("firstInhibitorKill")] - public bool FirstInhibitorKill { get; set; } - - /// - /// Flag indicating if participant got an assist on the first tower. - /// - [JsonProperty("firstTowerAssist")] - public bool FirstTowerAssist { get; set; } - - /// - /// Flag indicating if participant destroyed the first tower. - /// - [JsonProperty("firstTowerKill")] - public bool FirstTowerKill { get; set; } - - /// - /// Gold earned. - /// - [JsonProperty("goldEarned")] - public long GoldEarned { get; set; } - - /// - /// Gold spent. - /// - [JsonProperty("goldSpent")] - public long GoldSpent { get; set; } - - /// - /// Numer of inhibitor kills. - /// - [JsonProperty("inhibitorKills")] - public long InhibitorKills { get; set; } - - /// - /// First item ID. - /// - [JsonProperty("item0")] - public long Item0 { get; set; } - - /// - /// Second item ID. - /// - [JsonProperty("item1")] - public long Item1 { get; set; } - - /// - /// Third item ID. - /// - [JsonProperty("item2")] - public long Item2 { get; set; } - - /// - /// Fourth item ID. - /// - [JsonProperty("item3")] - public long Item3 { get; set; } - - /// - /// Fifth item ID. - /// - [JsonProperty("item4")] - public long Item4 { get; set; } - - /// - /// Sixth item ID. - /// - [JsonProperty("item5")] - public long Item5 { get; set; } - - /// - /// Seventh item ID. - /// - [JsonProperty("item6")] - public long Item6 { get; set; } - - /// - /// Number of killing sprees. - /// - [JsonProperty("killingSprees")] - public long KillingSprees { get; set; } - - /// - /// Number of kills. - /// - [JsonProperty("kills")] - public long Kills { get; set; } - - /// - /// Largest critical strike. - /// - [JsonProperty("largestCriticalStrike")] - public long LargestCriticalStrike { get; set; } - - /// - /// Largest killing spree. - /// - [JsonProperty("largestKillingSpree")] - public long LargestKillingSpree { get; set; } - - /// - /// Largest multi kill. - /// - [JsonProperty("largestMultiKill")] - public long LargestMultiKill { get; set; } - - /// - /// Magic damage dealt. - /// - [JsonProperty("magicDamageDealt")] - public long MagicDamageDealt { get; set; } - - /// - /// Magic damage dealt to champions. - /// - [JsonProperty("magicDamageDealtToChampions")] - public long MagicDamageDealtToChampions { get; set; } - - /// - /// Magic damage taken. - /// - [JsonProperty("magicDamageTaken")] - public long MagicDamageTaken { get; set; } - - /// - /// Minions kiled. - /// - [JsonProperty("totalMinionsKilled")] - public long TotalMinionsKilled { get; set; } - - /// - /// Neutral minions killed. - /// - [JsonProperty("neutralMinionsKilled")] - public long NeutralMinionsKilled { get; set; } - - /// - /// Neutral jungle minions killed in the enemy team's jungle. - /// - [JsonProperty("neutralMinionsKilledEnemyJungle")] - public long NeutralMinionsKilledEnemyJungle { get; set; } - - /// - /// Neutral jungle minions killed in your team's jungle. - /// - [JsonProperty("neutralMinionsKilledTeamJungle")] - public long NeutralMinionsKilledJungle { get; set; } - - /// - /// If game was a dominion game, number of node captures. - /// - [JsonProperty("nodeCapture")] - public long NodeCapture { get; set; } - - /// - /// If game was a dominion game, number of node capture assists. - /// - [JsonProperty("nodeCaptureAssist")] - public long NodeCaptureAssist { get; set; } - - /// - /// If game was a dominion game, number of node neutralizations. - /// - [JsonProperty("nodeNeutralize")] - public long NodeNeutralize { get; set; } - - /// - /// If game was a dominion game, number of node neutralization assists. - /// - [JsonProperty("nodeNeutralizeAssist")] - public long NodeNeutralizeAssist { get; set; } - - /// - /// If game was a dominion game, player's objectives score, otherwise 0. - /// - [JsonProperty("objectivePlayerScore")] - public long ObjectivePlayerScore { get; set; } - - /// - /// Number of penta kills. - /// - [JsonProperty("pentaKills")] - public long PentaKills { get; set; } - - /// - /// Physical damage dealt. - /// - [JsonProperty("physicalDamageDealt")] - public long PhysicalDamageDealt { get; set; } - - /// - /// Physical damage dealt to champions. - /// - [JsonProperty("physicalDamageDealtToChampions")] - public long PhysicalDamageDealtToChampions { get; set; } - - /// - /// Physical damage taken. - /// - [JsonProperty("physicalDamageTaken")] - public long PhysicalDamageTaken { get; set; } - - /// - /// Number of quadra kills. - /// - [JsonProperty("quadraKills")] - public long QuadraKills { get; set; } - - /// - /// Number of sight wards purchased. - /// - [JsonProperty("sightWardsBoughtInGame")] - public long SightWardsBoughtInGame { get; set; } - - /// - /// If game was a dominion game, number of completed team objectives (i.e., quests). - /// - [JsonProperty("teamObjective")] - public long TeamObjective { get; set; } - - /// - /// Total damage dealt. - /// - [JsonProperty("totalDamageDealt")] - public long TotalDamageDealt { get; set; } - - /// - /// Total damage dealt to champions. - /// - [JsonProperty("totalDamageDealtToChampions")] - public long TotalDamageDealtToChampions { get; set; } - - /// - /// Total damage taken. - /// - [JsonProperty("totalDamageTaken")] - public long TotalDamageTaken { get; set; } - - /// - /// Total heal. - /// - [JsonProperty("totalHeal")] - public long TotalHeal { get; set; } - - /// - /// If game was a dominion game, player's total score, otherwise 0. - /// - [JsonProperty("totalPlayerScore")] - public long TotalPlayerScore { get; set; } - - /// - /// If game was a dominion game, team rank of the player's total score (e.g., 1-5). - /// - [JsonProperty("totalScoreRank")] - public long TotalScoreRank { get; set; } - - /// - /// Total time crowd control dealt. - /// - [JsonProperty("totalTimeCrowdControlDealt")] - public long TotalTimeCrowdControlDealt { get; set; } - - /// - /// Total units healed. - /// - [JsonProperty("totalUnitsHealed")] - public long TotalUnitsHealed { get; set; } - - /// - /// Number of tower kills. - /// - [JsonProperty("towerKills")] - public long TowerKills { get; set; } - - /// - /// Number of triple kills. - /// - [JsonProperty("tripleKills")] - public long TripleKills { get; set; } - - /// - /// True damage dealt. - /// - [JsonProperty("trueDamageDealt")] - public long TrueDamageDealt { get; set; } - - /// - /// True damage dealt to champions. - /// - [JsonProperty("trueDamageDealtToChampions")] - public long TrueDamageDealtToChampions { get; set; } - - /// - /// True damage taken. - /// - [JsonProperty("trueDamageTaken")] - public long TrueDamageTaken { get; set; } - - /// - /// Number of unreal kills. - /// - [JsonProperty("unrealKills")] - public long UnrealKills { get; set; } - - /// - /// Vision score. - /// - [JsonProperty("visionScore")] - public long VisionScore { get; set; } - - /// - /// Number of vision wards purchased. - /// - [JsonProperty("visionWardsBoughtInGame")] - public long VisionWardsBoughtInGame { get; set; } - - /// - /// Number of wards killed. - /// - [JsonProperty("wardsKilled")] - public long WardsKilled { get; set; } - - /// - /// Number of wards placed. - /// - [JsonProperty("wardsPlaced")] - public long WardsPlaced { get; set; } - - /// - /// Flag indicating whether or not the participant won. - /// - [JsonProperty("win")] - public bool Winner { get; set; } - - #region Perk Stats - /// - /// Primary rune path. - /// - [JsonProperty("perkPrimaryStyle")] - public int PerkPrimaryStyle { get; set; } - /// - /// Secondary rune path. - /// - [JsonProperty("perkSubStyle")] - public int PerkSubStyle { get; set; } - - /// - /// Primary path keystone rune. - /// - [JsonProperty("perk0")] - public int Perk0 { get; set; } - /// - /// Primary path rune. - /// - [JsonProperty("perk1")] - public int Perk1 { get; set; } - /// - /// Primary path rune. - /// - [JsonProperty("perk2")] - public int Perk2 { get; set; } - /// - /// Primary path rune. - /// - [JsonProperty("perk3")] - public int Perk3 { get; set; } - /// - /// Secondary path rune. - /// - [JsonProperty("perk4")] - public int Perk4 { get; set; } - /// - /// Secondary path rune. - /// - [JsonProperty("perk5")] - public int Perk5 { get; set; } - - /// - /// Post game rune stat of Perk1. - /// - [JsonProperty("perk1Var1")] - public int Perk1Var1 { get; set; } - /// - /// Post game rune stat of Perk1. - /// - [JsonProperty("perk1Var2")] - public int Perk1Var2 { get; set; } - /// - /// Post game rune stat of Perk1. - /// - [JsonProperty("perk1Var3")] - public int Perk1Var3 { get; set; } - - /// - /// Post game rune stat of Perk2. - /// - [JsonProperty("perk2Var1")] - public int Perk2Var1 { get; set; } - /// - /// Post game rune stat of Perk2. - /// - [JsonProperty("perk2Var2")] - public int Perk2Var2 { get; set; } - /// - /// Post game rune stat of Perk2. - /// - [JsonProperty("perk2Var3")] - public int Perk2Var3 { get; set; } - - /// - /// Post game rune stat of Perk3. - /// - [JsonProperty("perk3Var1")] - public int Perk3Var1 { get; set; } - /// - /// Post game rune stat of Perk3. - /// - [JsonProperty("perk3Var2")] - public int Perk3Var2 { get; set; } - /// - /// Post game rune stat of Perk3. - /// - [JsonProperty("perk3Var3")] - public int Perk3Var3 { get; set; } - - /// - /// Post game rune stat of Perk4. - /// - [JsonProperty("perk4Var1")] - public int Perk4Var1 { get; set; } - /// - /// Post game rune stat of Perk4. - /// - [JsonProperty("perk4Var2")] - public int Perk4Var2 { get; set; } - /// - /// Post game rune stat of Perk4. - /// - [JsonProperty("perk4Var3")] - public int Perk4Var3 { get; set; } - - /// - /// Post game rune stat of Perk5. - /// - [JsonProperty("perk5Var1")] - public int Perk5Var1 { get; set; } - /// - /// Post game rune stat of Perk5. - /// - [JsonProperty("perk5Var2")] - public int Perk5Var2 { get; set; } - /// - /// Post game rune stat of Perk5. - /// - [JsonProperty("perk5Var3")] - public int Perk5Var3 { get; set; } - - /// - /// Rune stat - /// - [JsonProperty("statPerk0")] - public int StatPerk0 { get; set; } - - /// - /// Rune stat - /// - [JsonProperty("statPerk1")] - public int StatPerk1 { get; set; } - - /// - /// Rune stat - /// - [JsonProperty("statPerk2")] - public int StatPerk2 { get; set; } - #endregion - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/ParticipantTimeline.cs b/RiotSharp/Endpoints/MatchEndpoint/ParticipantTimeline.cs deleted file mode 100644 index cd0eddea..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/ParticipantTimeline.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Collections.Generic; -using Newtonsoft.Json; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// The timeline of a participant in a match - /// - public class ParticipantTimeline - { - /// - /// The lane of the participant. - /// - [JsonProperty("lane")] - public string Lane { get; set; } - - /// - /// The role of the participant. - /// - [JsonProperty("role")] - public string Role { get; set; } - - /// - /// The participant ID. - /// - [JsonProperty("participantId")] - public int ParticipantId { get; set; } - - /// - /// Gold for a specified period. - /// - [JsonProperty("goldPerMinDeltas")] - public Dictionary GoldPerMinDeltas { get; set; } - - /// - /// Experience difference versus the calculated lane opponent(s) for a specified period. - /// - [JsonProperty("xpDiffPerMinDeltas")] - public Dictionary XpDiffPerMinDeltas { get; set; } - - /// - /// Experience change for a specified period. - /// - [JsonProperty("xpPerMinDeltas")] - public Dictionary XpPerMinDeltas { get; set; } - - /// - /// Creep score difference versus the calculated lane opponent(s) for a specified period. - /// - [JsonProperty("csDiffPerMinDeltas")] - public Dictionary CsDiffPerMinDeltas { get; set; } - - /// - /// Creeps for a specified period. - /// - [JsonProperty("creepsPerMinDeltas")] - public Dictionary CreepsPerMinDeltas { get; set; } - - /// - /// Damage taken difference versus the calculated lane opponent(s) for a specified period. - /// - [JsonProperty("damageTakenDiffPerMinDeltas")] - public Dictionary DamageTakenDiffPerMinDeltas { get; set; } - - /// - /// Damage taken for a specified period. - /// - [JsonProperty("damageTakenPerMinDeltas")] - public Dictionary DamageTakenPerMinDeltas { get; set; } - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/ParticipantTimelineData.cs b/RiotSharp/Endpoints/MatchEndpoint/ParticipantTimelineData.cs deleted file mode 100644 index 6046f1c1..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/ParticipantTimelineData.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Newtonsoft.Json; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// Class holding timeline values (Match API). - /// - public class ParticipantTimelineData - { - internal ParticipantTimelineData() { } - - /// - /// Value per minute from 10 min to 20 min. - /// - [JsonProperty("tenToTwenty")] - public double TenToTwenty { get; set; } - - /// - /// Value per minute from 30 min to the end of the game. - /// - [JsonProperty("thirtyToEnd")] - public double ThirtyToEnd { get; set; } - - /// - /// Value per minute from 20 min to 30 min. - /// - [JsonProperty("twentyToThirty")] - public double TwentyToThirty { get; set; } - - /// - /// Value per minute from the beginning of the game to 10 min. - /// - [JsonProperty("zeroToTen")] - public double ZeroToTen { get; set; } - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/Player.cs b/RiotSharp/Endpoints/MatchEndpoint/Player.cs deleted file mode 100644 index 12a78052..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/Player.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Newtonsoft.Json; -using RiotSharp.Misc; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// Player in a match (Match API). - /// - public class Player - { - internal Player() { } - - /// - /// Current platform ID. - /// - [JsonProperty("currentPlatformId")] - public Platform CurrentPlatformId { get; set; } - - /// - /// Platform ID. - /// - [JsonProperty("platformId")] - public Platform PlatformId { get; set; } - - /// - /// Match history URI. - /// - [JsonProperty("matchHistoryUri")] - public string MatchHistoryUri { get; set; } - - /// - /// Profile icon ID. - /// - [JsonProperty("profileIcon")] - public int ProfileIcon { get; set; } - - /// - /// Current account ID. - /// - [JsonProperty("currentAccountId")] - public string CurrentAccountId { get; set; } - - /// - /// Account ID. - /// - [JsonProperty("accountId")] - public string AccountId { get; set; } - - /// - /// Summoner ID. - /// - [JsonProperty("summonerId")] - public string SummonerId { get; set; } - - /// - /// Summoner name. - /// - [JsonProperty("summonerName")] - public string SummonerName { get; set; } - } -} diff --git a/RiotSharp/Endpoints/MatchEndpoint/Rune.cs b/RiotSharp/Endpoints/MatchEndpoint/Rune.cs deleted file mode 100644 index 8da004a7..00000000 --- a/RiotSharp/Endpoints/MatchEndpoint/Rune.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Newtonsoft.Json; - -namespace RiotSharp.Endpoints.MatchEndpoint -{ - /// - /// Class representing a rune of a participant (Match API). - /// - public class Rune - { - internal Rune() { } - - /// - /// Rune rank. - /// - [JsonProperty("rank")] - public int Rank { get; set; } - - /// - /// Rune ID. - /// - [JsonProperty("runeId")] - public int RuneId { get; set; } - } -} From 93deac04df804e85a7f9ce5f43d00173b2ffe5d8 Mon Sep 17 00:00:00 2001 From: Tom Eckstein Date: Wed, 19 May 2021 12:25:43 +0200 Subject: [PATCH 6/8] Adjust Matchlist call --- .../Endpoints/MatchEndpoint/MatchEndpoint.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchEndpoint.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchEndpoint.cs index 02dc74b2..c2f6bbc8 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/MatchEndpoint.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/MatchEndpoint.cs @@ -54,9 +54,9 @@ public async Task GetMatchAsync(Region region, string matchId) /// public async Task> GetMatchListAsync(Region region, string puuId, - long? beginIndex = null, long? endIndex = null) + long? start = null, long? count = null) { - var addedArguments = CreateArgumentsListForMatchListRequest(beginIndex, endIndex); + var addedArguments = CreateArgumentsListForMatchListRequest(start, count); var json = await _requester.CreateGetRequestAsync(MatchRootUrl + string.Format(MatchListByPuuIdUrl, puuId), region, addedArguments).ConfigureAwait(false); @@ -82,17 +82,17 @@ public async Task GetMatchTimelineAsync(Region region, string mat #region Helper private List CreateArgumentsListForMatchListRequest( - long? beginIndex = null, - long? endIndex = null) + long? start = null, + long? count = null) { var addedArguments = new List(); - if (beginIndex != null) + if (start != null) { - addedArguments.Add($"beginIndex={beginIndex}"); + addedArguments.Add($"start={start}"); } - if (endIndex != null) + if (count != null) { - addedArguments.Add($"endIndex={endIndex}"); + addedArguments.Add($"count={count}"); } return addedArguments; } From 2cd3ffc757b27a359fe3a699370a9c6a72c08863 Mon Sep 17 00:00:00 2001 From: Tom Eckstein Date: Wed, 19 May 2021 14:30:53 +0200 Subject: [PATCH 7/8] smaller fixes --- RiotSharp/Endpoints/Interfaces/IMatchEndpoint.cs | 8 ++++---- RiotSharp/Endpoints/MatchEndpoint/MatchInfo.cs | 2 +- RiotSharp/Misc/Converters/RoleConverter.cs | 4 ++++ RiotSharp/Misc/Role.cs | 12 +++++++++++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/RiotSharp/Endpoints/Interfaces/IMatchEndpoint.cs b/RiotSharp/Endpoints/Interfaces/IMatchEndpoint.cs index 50dea232..d9778358 100644 --- a/RiotSharp/Endpoints/Interfaces/IMatchEndpoint.cs +++ b/RiotSharp/Endpoints/Interfaces/IMatchEndpoint.cs @@ -24,12 +24,12 @@ public interface IMatchEndpoint /// /// Region in which the summoner is. /// PuuID for which you want to retrieve the match list. - /// The begin index to use for fetching matches. - /// The end index to use for fetching matches. + /// The begin index to use for fetching matches. + /// The amount of matches to fetch. /// A list of MatchIds. Task> GetMatchListAsync(Region region, string puuidId, - long? beginIndex = null, - long? endIndex = null); + long? start = null, + long? count = null); /// /// Get match timeline by match ID asynchronously. diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchInfo.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchInfo.cs index 79920200..c0c52039 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/MatchInfo.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/MatchInfo.cs @@ -43,7 +43,7 @@ internal MatchInfo() { } /// Name of the game. /// [JsonProperty("gameName")] - public long GameName { get; set; } + public string GameName { get; set; } /// /// The date time of the game start. diff --git a/RiotSharp/Misc/Converters/RoleConverter.cs b/RiotSharp/Misc/Converters/RoleConverter.cs index 5b9b8516..5eac2bbf 100644 --- a/RiotSharp/Misc/Converters/RoleConverter.cs +++ b/RiotSharp/Misc/Converters/RoleConverter.cs @@ -28,8 +28,12 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist return Role.Solo; case "DUO_CARRY": return Role.DuoCarry; + case "CARRY": + return Role.Carry; case "DUO_SUPPORT": return Role.DuoSupport; + case "SUPPORT": + return Role.Support; default: return null; } diff --git a/RiotSharp/Misc/Role.cs b/RiotSharp/Misc/Role.cs index 604ca59f..a1cf6f94 100644 --- a/RiotSharp/Misc/Role.cs +++ b/RiotSharp/Misc/Role.cs @@ -32,7 +32,17 @@ public enum Role /// /// Corresponds to support. /// - DuoSupport + DuoSupport, + + /// + /// Corresponds to ad carry. + /// + Carry, + + /// + /// Corresponds to support. + /// + Support } static class RoleExtension From b9ea70c68ba0e665b3d62747067f7795b0436064 Mon Sep 17 00:00:00 2001 From: Tom Eckstein Date: Fri, 4 Jun 2021 10:35:12 +0200 Subject: [PATCH 8/8] Add Gold Gain --- RiotSharp/Endpoints/MatchEndpoint/MatchEvent.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RiotSharp/Endpoints/MatchEndpoint/MatchEvent.cs b/RiotSharp/Endpoints/MatchEndpoint/MatchEvent.cs index b1c08f5d..a0d9f54b 100644 --- a/RiotSharp/Endpoints/MatchEndpoint/MatchEvent.cs +++ b/RiotSharp/Endpoints/MatchEndpoint/MatchEvent.cs @@ -62,6 +62,12 @@ internal MatchEvent() { } [JsonProperty("beforeId")] public int ItemBeforeId { get; set; } + /// + /// Amount of gold gained by the event. Only peresent if relevant. + /// + [JsonProperty("goldGain")] + public int GoldDain { get; set; } + /// /// The item ID of the event. Only present if relevant. ///