1

I am currently using the java-version of the Riot api, made by rithms, (https://github.com/rithms/riot-api-java) and I am trying to receive the name of a champion, as I am currently "just" able to get the id.

RankedStats rankedStats = api.getRankedStats(api.getSummonerByName("AscendedKitten").getId());

Now, when printing out the results of

rankedStats.getChampions();

it will (of course) return the Ids. I noticed that

net.rithms.riot.dto.Champion.Champion

has a methode returning the name, but (because I am failing at reading the Documentation) I haven't found out how to cast / get an instance of the object yet.

I am sorry for the basic-question, and I hope you don't have too much trouble trying to help me :3

Thanks in advance!

John Slegers
  • 45,213
  • 22
  • 199
  • 169
Cath
  • 460
  • 6
  • 21
  • Look into this class. [Champion.java](https://github.com/rithms/riot-api-java/blob/master/src/net/rithms/riot/dto/Static/Champion.java) – gonzo Jan 22 '16 at 17:48
  • I've already looked into this class, but found no way to cast something (for example a champion from the champion-list, in a for loop) to riot.dto.Static.Champion – Cath Jan 22 '16 at 18:57
  • use the [static api](https://github.com/rithms/riot-api-java/blob/master/src/net/rithms/riot/api/StaticDataApi.java) – gonzo Jan 22 '16 at 19:13

1 Answers1

1

Use the RiotApi class' getDataChampion(Region region, int id) method, then use the getName() method on the champion it returns.

nija123098
  • 24
  • 6