Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Evolves Logging #1496

Merged
merged 4 commits into from
Jul 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions PoGo.NecroBot.CLI/ConsoleEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ public void HandleEvent(DisplayHighestsPokemonEvent evt, ISession session)
LogLevel.Info, ConsoleColor.Yellow);
}

public void HandleEvent( EvolveCountEvent evt, ISession session )
{
Logger.Write( "[Evolves] Potential Evolves: " + evt.Evolves, LogLevel.Update, ConsoleColor.White );
}

public void HandleEvent(UpdateEvent evt, ISession session)
{
Logger.Write(evt.ToString(), LogLevel.Update);
Expand Down
13 changes: 13 additions & 0 deletions PoGo.NecroBot.Logic/Event/EvolveCountEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PoGo.NecroBot.Logic.Event
{
public class EvolveCountEvent : IEvent
{
public int Evolves;
}
}
2 changes: 1 addition & 1 deletion PoGo.NecroBot.Logic/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("0.3.3")]
[assembly: AssemblyVersion("0.4.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
4 changes: 2 additions & 2 deletions PoGo.NecroBot.Logic/Tasks/DisplayPokemonStatsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static async Task Execute(ISession session)
var tokens = dgdfs.Split(new[] {"id"}, StringSplitOptions.None);
var splitone = tokens[1].Split('"');
var iv = session.Inventory.GetPerfect(pokemon.Item1);
if (iv > session.LogicSettings.UpgradePokemonIvMinimum)
if (iv >= session.LogicSettings.UpgradePokemonIvMinimum)
{
PokemonId.Add(ulong.Parse(splitone[2]));
}
Expand All @@ -90,7 +90,7 @@ public static async Task Execute(ISession session)
var tokensSplit = tokens[1].Split(new[] {"cp"}, StringSplitOptions.None);
var tokenSplitAgain = tokensSplit[1].Split(' ');
var tokenSplitAgain2 = tokenSplitAgain[1].Split(',');
if (float.Parse(tokenSplitAgain2[0]) > session.LogicSettings.UpgradePokemonCpMinimum)
if (float.Parse(tokenSplitAgain2[0]) >= session.LogicSettings.UpgradePokemonCpMinimum)
{
PokemonIdcp.Add(ulong.Parse(splitone[2]));
}
Expand Down
5 changes: 5 additions & 0 deletions PoGo.NecroBot.Logic/Tasks/EvolvePokemonTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
var pokemonToEvolveTask = await session.Inventory.GetPokemonToEvolve(session.LogicSettings.PokemonsToEvolve);
var pokemonToEvolve = pokemonToEvolveTask.ToList();

session.EventDispatcher.Send( new EvolveCountEvent
{
Evolves = pokemonToEvolve.Count
} );

if (pokemonToEvolve.Any())
{
var inventoryContent = await session.Inventory.GetItems();
Expand Down