Fixed a NullReferenceException issue
Fixed a NullReferenceException issue
diff --git a/PokemonGo.RocketAPI.Logic/Inventory.cs b/PokemonGo.RocketAPI.Logic/Inventory.cs
index d360ac3..f954abb 100644
--- a/PokemonGo.RocketAPI.Logic/Inventory.cs
+++ b/PokemonGo.RocketAPI.Logic/Inventory.cs
@@ -14,12 +14,6 @@ namespace PokemonGo.RocketAPI.Logic
public class Inventory
{
private readonly Client _client;
- private readonly ISettings _clientSettings;
-
- public Inventory(ISettings clientSettings)
- {
- _clientSettings = clientSettings;
- }
public Inventory(Client client)
{
@@ -73,7 +67,7 @@ namespace PokemonGo.RocketAPI.Logic
return pokemons.OrderByDescending(x => Logic.CalculatePokemonPerfection(x)).Take(limit);
}
- public async Task<IEnumerable<PokemonData>> GetDuplicatePokemonToTransfer(bool keepPokemonsThatCanEvolve = false, IEnumerable<PokemonId> filter = null)
+ public async Task<IEnumerable<PokemonData>> GetDuplicatePokemonToTransfer(bool keepPokemonsThatCanEvolve = false, int KeepMinDuplicatePokemon = 1, IEnumerable<PokemonId> filter = null)
{
var myPokemon = await GetPokemons();
@@ -123,7 +117,7 @@ namespace PokemonGo.RocketAPI.Logic
p.Where(x => x.Favorite == 0)
.OrderByDescending(x => x.Cp)
.ThenBy(n => n.StaminaMax)
- .Skip(_clientSettings.KeepMinDuplicatePokemon)
+ .Skip(KeepMinDuplicatePokemon)
.ToList());
}
diff --git a/PokemonGo.RocketAPI.Logic/Logic.cs b/PokemonGo.RocketAPI.Logic/Logic.cs
index 732f143..a289bc3 100644
--- a/PokemonGo.RocketAPI.Logic/Logic.cs
+++ b/PokemonGo.RocketAPI.Logic/Logic.cs
@@ -303,7 +303,7 @@ namespace PokemonGo.RocketAPI.Logic
private async Task TransferDuplicatePokemon(bool keepPokemonsThatCanEvolve = false)
{
- var duplicatePokemons = await _inventory.GetDuplicatePokemonToTransfer(keepPokemonsThatCanEvolve, _clientSettings.PokemonsNotToTransfer);
+ var duplicatePokemons = await _inventory.GetDuplicatePokemonToTransfer(keepPokemonsThatCanEvolve, _clientSettings.KeepMinDuplicatePokemon, _clientSettings.PokemonsNotToTransfer);
// Currently not returns the correct value
//if (duplicatePokemons != null && duplicatePokemons.Any())
// Logger.Normal(ConsoleColor.DarkYellow, $"(TRANSFER) {duplicatePokemons.Count()} Pokemon:");
diff --git a/PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj b/PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj
index 2c675ab..63a0897 100644
--- a/PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj
+++ b/PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj
@@ -17,7 +17,7 @@
<UpdateAssemblyInfoVersion>False</UpdateAssemblyInfoVersion>
<AssemblyVersionSettings>YearStamp.MonthStamp.DayStamp.Increment</AssemblyVersionSettings>
<PrimaryVersionType>AssemblyVersionAttribute</PrimaryVersionType>
- <AssemblyVersion>2016.7.23.79</AssemblyVersion>
+ <AssemblyVersion>2016.7.23.86</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
diff --git a/PokemonGo.RocketAPI/Properties/AssemblyInfo.cs b/PokemonGo.RocketAPI/Properties/AssemblyInfo.cs
index 005d152..e583a5c 100644
--- a/PokemonGo.RocketAPI/Properties/AssemblyInfo.cs
+++ b/PokemonGo.RocketAPI/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2016.7.23.79")]
+[assembly: AssemblyVersion("2016.7.23.87")]
[assembly: AssemblyFileVersion("1.0.0.0")]
You may download the files in Public Git.