Add KeepMinDuplicatePokemon to UserSettings and Inventory Logic
Add KeepMinDuplicatePokemon to UserSettings and Inventory Logic
Thx @ https://github.com/NecronomiconCoding/Pokemon-Go-Bot/commit/d11a63d36fbed4d66d40e92d92915e4ab7302ac2
diff --git a/PokemonGo.RocketAPI.Console/App.config b/PokemonGo.RocketAPI.Console/App.config
index 41f3c74..70c81f6 100644
--- a/PokemonGo.RocketAPI.Console/App.config
+++ b/PokemonGo.RocketAPI.Console/App.config
@@ -39,10 +39,10 @@
</value>
</setting>
<setting name="DefaultLatitude" serializeAs="String">
- <value>0</value>
+ <value>48.78</value>
</setting>
<setting name="DefaultLongitude" serializeAs="String">
- <value>0</value>
+ <value>9.18274</value>
</setting>
<setting name="EvolveAllPokemonWithEnoughCandy" serializeAs="String">
<value>False</value>
@@ -51,14 +51,17 @@
<value>True</value>
</setting>
<setting name="PtcUsername" serializeAs="String">
- <value>username</value>
+ <value>Jarolon</value>
</setting>
<setting name="PtcPassword" serializeAs="String">
- <value>password</value>
+ <value>5dfM56Rh</value>
</setting>
<setting name="UsePokemonToNotCatchFilter" serializeAs="String">
<value>False</value>
</setting>
+ <setting name="KeepMinDuplicatePokemon" serializeAs="String">
+ <value>1</value>
+ </setting>
</PokemonGo.RocketAPI.Console.UserSettings>
</userSettings>
</configuration>
\ No newline at end of file
diff --git a/PokemonGo.RocketAPI.Console/Settings.cs b/PokemonGo.RocketAPI.Console/Settings.cs
index 1f79e63..32c76a1 100644
--- a/PokemonGo.RocketAPI.Console/Settings.cs
+++ b/PokemonGo.RocketAPI.Console/Settings.cs
@@ -26,6 +26,7 @@ namespace PokemonGo.RocketAPI.Console
public bool EvolveAllPokemonWithEnoughCandy => UserSettings.Default.EvolveAllPokemonWithEnoughCandy;
public bool TransferDuplicatePokemon => UserSettings.Default.TransferDuplicatePokemon;
public bool UsePokemonToNotCatchFilter => UserSettings.Default.UsePokemonToNotCatchFilter;
+ public int KeepMinDuplicatePokemon => UserSettings.Default.KeepMinDuplicatePokemon;
private ICollection<PokemonId> _pokemonsToEvolve;
private ICollection<PokemonId> _pokemonsNotToTransfer;
diff --git a/PokemonGo.RocketAPI.Console/UserSettings.Designer.cs b/PokemonGo.RocketAPI.Console/UserSettings.Designer.cs
index ea7b982..f24a4fc 100644
--- a/PokemonGo.RocketAPI.Console/UserSettings.Designer.cs
+++ b/PokemonGo.RocketAPI.Console/UserSettings.Designer.cs
@@ -97,7 +97,7 @@ namespace PokemonGo.RocketAPI.Console {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0")]
+ [global::System.Configuration.DefaultSettingValueAttribute("48.78")]
public double DefaultLatitude {
get {
return ((double)(this["DefaultLatitude"]));
@@ -109,7 +109,7 @@ namespace PokemonGo.RocketAPI.Console {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0")]
+ [global::System.Configuration.DefaultSettingValueAttribute("9.18274")]
public double DefaultLongitude {
get {
return ((double)(this["DefaultLongitude"]));
@@ -145,7 +145,7 @@ namespace PokemonGo.RocketAPI.Console {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("username")]
+ [global::System.Configuration.DefaultSettingValueAttribute("Jarolon")]
public string PtcUsername {
get {
return ((string)(this["PtcUsername"]));
@@ -157,7 +157,7 @@ namespace PokemonGo.RocketAPI.Console {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("password")]
+ [global::System.Configuration.DefaultSettingValueAttribute("5dfM56Rh")]
public string PtcPassword {
get {
return ((string)(this["PtcPassword"]));
@@ -178,5 +178,17 @@ namespace PokemonGo.RocketAPI.Console {
this["UsePokemonToNotCatchFilter"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("1")]
+ public string KeepMinDuplicatePokemon {
+ get {
+ return ((string)(this["KeepMinDuplicatePokemon"]));
+ }
+ set {
+ this["KeepMinDuplicatePokemon"] = value;
+ }
+ }
}
}
diff --git a/PokemonGo.RocketAPI.Console/UserSettings.settings b/PokemonGo.RocketAPI.Console/UserSettings.settings
index 55281ac..5f42733 100644
--- a/PokemonGo.RocketAPI.Console/UserSettings.settings
+++ b/PokemonGo.RocketAPI.Console/UserSettings.settings
@@ -22,10 +22,10 @@
</Value>
</Setting>
<Setting Name="DefaultLatitude" Type="System.Double" Scope="User">
- <Value Profile="(Default)">0</Value>
+ <Value Profile="(Default)">48.78</Value>
</Setting>
<Setting Name="DefaultLongitude" Type="System.Double" Scope="User">
- <Value Profile="(Default)">0</Value>
+ <Value Profile="(Default)">9.18274</Value>
</Setting>
<Setting Name="EvolveAllPokemonWithEnoughCandy" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
@@ -34,13 +34,16 @@
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="PtcUsername" Type="System.String" Scope="User">
- <Value Profile="(Default)">username</Value>
+ <Value Profile="(Default)">Jarolon</Value>
</Setting>
<Setting Name="PtcPassword" Type="System.String" Scope="User">
- <Value Profile="(Default)">password</Value>
+ <Value Profile="(Default)">5dfM56Rh</Value>
</Setting>
<Setting Name="UsePokemonToNotCatchFilter" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
+ <Setting Name="KeepMinDuplicatePokemon" Type="System.String" Scope="User">
+ <Value Profile="(Default)">1</Value>
+ </Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
diff --git a/PokemonGo.RocketAPI.Logic/Inventory.cs b/PokemonGo.RocketAPI.Logic/Inventory.cs
index d0700ad..d360ac3 100644
--- a/PokemonGo.RocketAPI.Logic/Inventory.cs
+++ b/PokemonGo.RocketAPI.Logic/Inventory.cs
@@ -14,12 +14,18 @@ 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)
{
_client = client;
}
-
+
public async Task<IEnumerable<PokemonData>> GetPokemons()
{
var inventory = await _client.GetInventory();
@@ -117,7 +123,7 @@ namespace PokemonGo.RocketAPI.Logic
p.Where(x => x.Favorite == 0)
.OrderByDescending(x => x.Cp)
.ThenBy(n => n.StaminaMax)
- .Skip(1)
+ .Skip(_clientSettings.KeepMinDuplicatePokemon)
.ToList());
}
diff --git a/PokemonGo.RocketAPI/ISettings.cs b/PokemonGo.RocketAPI/ISettings.cs
index d07a648..4771114 100644
--- a/PokemonGo.RocketAPI/ISettings.cs
+++ b/PokemonGo.RocketAPI/ISettings.cs
@@ -23,6 +23,7 @@ namespace PokemonGo.RocketAPI
bool EvolveAllPokemonWithEnoughCandy { get; }
bool TransferDuplicatePokemon { get; }
bool UsePokemonToNotCatchFilter { get; }
+ int KeepMinDuplicatePokemon { get; }
ICollection<KeyValuePair<AllEnum.ItemId, int>> ItemRecycleFilter { get; set; }
diff --git a/PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj b/PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj
index 45a53e9..5df0164 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.74</AssemblyVersion>
+ <AssemblyVersion>2016.7.23.78</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -133,9 +133,6 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
- <ItemGroup>
- <None Include="Resources\PokemonsNotToCatch.txt" />
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/PokemonGo.RocketAPI/Properties/AssemblyInfo.cs b/PokemonGo.RocketAPI/Properties/AssemblyInfo.cs
index c32bc17..a55b0fc 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.75")]
+[assembly: AssemblyVersion("2016.7.23.78")]
[assembly: AssemblyFileVersion("1.0.0.0")]
You may download the files in Public Git.