Skip to content

Commit

Permalink
Merge pull request NecronomiconCoding#1398 from nicoschmitt/pkmlistiv
Browse files Browse the repository at this point in the history
event: add iv to pokemonlist
  • Loading branch information
NecronomiconCoding authored Jul 30, 2016
2 parents f2213cc + 24faf8f commit 8a84ef9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PoGo.NecroBot.Logic/Event/PokemonListEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ namespace PoGo.NecroBot.Logic.Event
{
public class PokemonListEvent : IEvent
{
public List<PokemonData> PokemonList;
public List<Tuple<PokemonData, double>> PokemonList;
}
}
3 changes: 2 additions & 1 deletion PoGo.NecroBot.Logic/Tasks/PokemonListTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ public class PokemonListTask
public static async Task Execute(ISession session)
{
var allPokemonInBag = await session.Inventory.GetHighestsCp(1000);
var pkmWithIV = allPokemonInBag.Select(p => Tuple.Create(p, PokemonInfo.CalculatePokemonPerfection(p)));
session.EventDispatcher.Send(
new PokemonListEvent
{
PokemonList = allPokemonInBag.ToList()
PokemonList = pkmWithIV.ToList()
});
await Task.Delay(500);
}
Expand Down

0 comments on commit 8a84ef9

Please sign in to comment.