Skip to content

Commit

Permalink
Hexakill for PlayerStatsSummary, fixes #83
Browse files Browse the repository at this point in the history
  • Loading branch information
BenFradet committed Nov 4, 2014
1 parent 68422d7 commit 783740e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RiotSharp/StatsEndpoint/Converters/PlayerStatsSummaryType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public enum PlayerStatsSummaryType
URF,
URFBots,
NightmareBot,
Ascension
Ascension,
Hexakill
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
return PlayerStatsSummaryType.NightmareBot;
case "Ascension":
return PlayerStatsSummaryType.Ascension;
case "Hexakill":
return PlayerStatsSummaryType.Hexakill;
default:
return null;
}
Expand Down
18 changes: 18 additions & 0 deletions RiotSharpExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Configuration;
using System.Globalization;
using System.Linq;
using System.Collections.Generic;
using RiotSharp;

namespace RiotSharpExample
Expand All @@ -23,6 +25,22 @@ static void Main(string[] args)

var shardStatus = statusApi.GetShardStatus(Region.euw);

var statSummaries = api.GetStatsSummaries(Region.euw, id);

var championIds = new List<int>();
for (int i = 0; i < 30; i += 15)
{
var matches = api.GetMatchHistory(Region.euw, id, i, i + 15, null,
new List<Queue>() { Queue.RankedSolo5x5 });
foreach (var match in matches)
{
championIds.Add(match.Participants[0].ChampionId);
}
}
var mostPlayedChampId = championIds.GroupBy(c => c).OrderByDescending(g => g.Count()).FirstOrDefault().Key;
var mostPlayedChamp = staticApi.GetChampion(Region.euw, mostPlayedChampId);
Console.WriteLine(mostPlayedChamp.Name);

var games = api.GetRecentGames(Region.euw, id);

Console.ReadLine();
Expand Down

0 comments on commit 783740e

Please sign in to comment.