meraki-analytics / orianna

A Java framework for the Riot Games League of Legends API (http://developer.riotgames.com/).
MIT License
182 stars 56 forks source link

Combined Stats from Runes #30

Closed JeffreyCA closed 9 years ago

JeffreyCA commented 9 years ago

I have a List<RuneCount> called runeCount. Right now this code just displays the number and the name of a rune a summoner has. How would I gather the combined stats from the runes? (Like how much additional armor, ad, ap, etc. the player gets from his runes)

String text = "";

for (int i = 0; i < runeCount.size(); i++) {
     text += runeCount.get(i).getRune().getName() + " " + runeCount.get(i).getCount() + "x \n";
}

Do I use runeCount.get(i).getRune().getStats() ?

robrua commented 9 years ago

What is a RuneCount? It looks like you may be talking about RuneSlot instead.

runeSlot.getRune().getStats()

will give you the stats for the Rune as sent by the Riot API (unfortunately some of the stats aren't properly included in what Riot sends and may be missing).

You can sum these over the entire RunePage to get aggregate stats for it.

JeffreyCA commented 9 years ago

I got runeCount from: final List<RuneCount> runeCount = participants.get(position).getRunes(); According to this, getRunes() is java.util.List<RuneCount>. Am I doing something wrong?

robrua commented 9 years ago

Nope, seems fine. I'd just forgotten that type existed. You should be able to access the stats with getRune().getStats() as you thought

JeffreyCA commented 9 years ago

Ok, so I think I have to run each rune through all of these methods listed here?

robrua commented 9 years ago

As things are now, yes. You should also multiply by the count in the RuneCount.

JeffreyCA commented 9 years ago

Got it, thank you

JeffreyCA commented 9 years ago

Sorry, one quick question, what does the Mod mean in getFlatArmorMod(), getFlatCritChanceMod(), etc, ?