Skip to content

Commit

Permalink
Merge pull request #107 from skupfer/keepmindup_fix
Browse files Browse the repository at this point in the history
Fix KeepMinDuplicatePokemon
  • Loading branch information
NecronomiconCoding authored Jul 23, 2016
2 parents 66e76ff + 7b0ee37 commit 0cb553e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions PokemonGo.RocketAPI.Console/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
<setting name="UsePokemonToNotCatchFilter" serializeAs="String">
<value>False</value>
</setting>
<setting name="KeepMinDuplicatePokemon" serializeAs="String">
<value>1</value>
</setting>
</PokemonGo.RocketAPI.Console.UserSettings>
</userSettings>
</configuration>
1 change: 1 addition & 0 deletions PokemonGo.RocketAPI.Console/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class Settings : ISettings
public bool TransferDuplicatePokemon => UserSettings.Default.TransferDuplicatePokemon;
public int DelayBetweenPokemonCatch => UserSettings.Default.DelayBetweenPokemonCatch;
public bool UsePokemonToNotCatchFilter => UserSettings.Default.UsePokemonToNotCatchFilter;
public int KeepMinDuplicatePokemon => UserSettings.Default.KeepMinDuplicatePokemon;

public string GoogleRefreshToken
{
Expand Down
12 changes: 12 additions & 0 deletions PokemonGo.RocketAPI.Console/UserSettings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions PokemonGo.RocketAPI.Console/UserSettings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@
<Setting Name="UsePokemonToNotCatchFilter" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="KeepMinDuplicatePokemon" Type="System.Int32" Scope="User">
<Value Profile="(Default)">1</Value>
</Setting>
</Settings>
</SettingsFile>
2 changes: 1 addition & 1 deletion PokemonGo.RocketAPI.Logic/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public async Task<IEnumerable<PokemonData>> GetDuplicatePokemonToTransfer(
p =>
p.OrderByDescending(x => x.Cp)
.ThenBy(n => n.StaminaMax)
.Skip(1)
.Skip(_client.Settings.KeepMinDuplicatePokemon)
.ToList());
}

Expand Down
1 change: 1 addition & 0 deletions PokemonGo.RocketAPI/ISettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public interface ISettings
bool TransferDuplicatePokemon { get; }
int DelayBetweenPokemonCatch { get; }
bool UsePokemonToNotCatchFilter { get; }
int KeepMinDuplicatePokemon { get; }
ICollection<KeyValuePair<ItemId, int>> ItemRecycleFilter { get; }

ICollection<PokemonId> PokemonsToEvolve { get; }
Expand Down

0 comments on commit 0cb553e

Please sign in to comment.