Skip to content

Commit d086128

Browse files
dgraneyBenFradet
authored andcommittedAug 25, 2017
Updated README.md to align with latest build (BenFradet#462)
1 parent 151edb7 commit d086128

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed
 

‎README.md

+24-21
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In order to use the api you need an api key which you can get [here](https://dev
3434

3535
Entry point to the api if you do not own a production API key:
3636
```c#
37-
var api = RiotApi.GetInstance("YOUR_API_KEY");
37+
var api = RiotApi.GetDevelopmentInstance("YOUR_API_KEY");
3838
```
3939

4040
If you do own a production API key you can specify your own rate limits:
@@ -47,33 +47,14 @@ To get a summoner:
4747
```c#
4848
try
4949
{
50-
var summoner = api.GetSummoner(Region.euw, "StopOFlop");
50+
var summoner = api.GetSummonerByName(Region.euw, "StopOFlop");
5151
}
5252
catch (RiotSharpException ex)
5353
{
5454
// Handle the exception however you want.
5555
}
5656
```
5757

58-
To get the stats in ranked for a specific champion for this summoner:
59-
```c#
60-
try
61-
{
62-
var varusRanked = summoner.GetStatsRanked(Season.Season3)
63-
.Where((s) => s.Name != null && s.Name.Equals("Varus"))
64-
.FirstOrDefault();
65-
}
66-
catch (RiotSharpException ex)
67-
{
68-
// Handle the exception however you want.
69-
}
70-
71-
foreach (var stat in varusRanked.Stats)
72-
{
73-
Console.WriteLine(stat.Name + " " + stat.Value);
74-
}
75-
```
76-
7758
You can find a list of all the available operations in [RiotApi in the documentation](http://benfradet.github.io/RiotSharp/api/RiotSharp.RiotApi.html).
7859

7960
### Tournament API
@@ -143,6 +124,28 @@ foreach (var champion in champions)
143124
}
144125
```
145126

127+
Additionally, you can use the regular api and static api to, for example, retrieve champion masteries for the summoner:
128+
```c#
129+
try
130+
{
131+
var championMasteries = api.GetChampionMasteries(RiotSharp.Misc.Region.na, summoner.Id);
132+
}
133+
catch (RiotSharpException ex)
134+
{
135+
// Handle the exception however you want.
136+
}
137+
138+
foreach (var championMastery in championMasteries)
139+
{
140+
var id = championMastery.ChampionId;
141+
var name = staticApi.GetChampion(RiotSharp.Misc.Region.euw, id).Name;
142+
var level = championMastery.ChampionLevel;
143+
var points = championMastery.ChampionPoints;
144+
145+
Console.WriteLine($" • **Level {level} {name}** {points} Points");
146+
}
147+
```
148+
146149
You can find a list of all the available operations in [StaticRiotApi in the Documentation](http://benfradet.github.io/RiotSharp/api/RiotSharp.StaticRiotApi.html).
147150

148151
### Status API

0 commit comments

Comments
 (0)
Please sign in to comment.