@@ -33,8 +33,8 @@ public async Task<IReadOnlyCollection<GameItem>> GetGameItemsAsync(string langua
3333
3434 AddToParametersIfHasValue ( "language" , language , parameters ) ;
3535
36- var teamInfos = await CallMethodAsync < GameItemResultContainer > ( "GetGameItems" , 1 ) ;
37- return new ReadOnlyCollection < GameItem > ( teamInfos . Result . Items ) ;
36+ var gameItems = await CallMethodAsync < GameItemResultContainer > ( "GetGameItems" , 1 ) ;
37+ return new ReadOnlyCollection < GameItem > ( gameItems . Result . Items ) ;
3838 }
3939
4040 public async Task < IReadOnlyCollection < Hero > > GetHeroesAsync ( string language = "" , bool itemizedOnly = false )
@@ -46,8 +46,40 @@ public async Task<IReadOnlyCollection<Hero>> GetHeroesAsync(string language = ""
4646 AddToParametersIfHasValue ( "language" , language , parameters ) ;
4747 AddToParametersIfHasValue ( "itemizedonly" , itemizedOnlyValue , parameters ) ;
4848
49- var teamInfos = await CallMethodAsync < HeroResultContainer > ( "GetHeroes" , 1 ) ;
50- return new ReadOnlyCollection < Hero > ( teamInfos . Result . Heroes ) ;
49+ var heroes = await CallMethodAsync < HeroResultContainer > ( "GetHeroes" , 1 ) ;
50+ return new ReadOnlyCollection < Hero > ( heroes . Result . Heroes ) ;
51+ }
52+
53+ /// <summary>
54+ /// It is important to note that the "items" this method is referring to are not the in game items. These are actually cosmetic items found in the DOTA 2 store and workshop.
55+ /// </summary>
56+ /// <param name="iconName"></param>
57+ /// <param name="iconType"></param>
58+ /// <returns></returns>
59+ public async Task < string > GetItemIconPathAsync ( string iconName , string iconType = "" )
60+ {
61+ if ( String . IsNullOrEmpty ( iconName ) )
62+ {
63+ throw new ArgumentNullException ( "iconName" ) ;
64+ }
65+
66+ List < SteamWebRequestParameter > parameters = new List < SteamWebRequestParameter > ( ) ;
67+
68+ AddToParametersIfHasValue ( "iconname" , iconName , parameters ) ;
69+ AddToParametersIfHasValue ( "icontype" , iconType , parameters ) ;
70+
71+ var itemIconPath = await CallMethodAsync < ItemIconPathResultContainer > ( "GetItemIconPath" , 1 ) ;
72+ return itemIconPath . Result . Path ;
73+ }
74+
75+ public async Task < RarityResult > GetRaritiesAsync ( string language = "" )
76+ {
77+ List < SteamWebRequestParameter > parameters = new List < SteamWebRequestParameter > ( ) ;
78+
79+ AddToParametersIfHasValue ( "language" , language , parameters ) ;
80+
81+ var raritiesContainer = await CallMethodAsync < RarityResultContainer > ( "GetRarities" , 1 ) ;
82+ return raritiesContainer . Result ;
5183 }
5284 }
5385}
0 commit comments