Conversation
…th a better one, if one is captured.
|
@hahnrobert why not add this configuration to |
|
|
||
| def should_release_pokemon(self, pokemon_name, cp, iv, response_dict): | ||
| # Returns True if pokemon is better than other_pokemon | ||
| def _is_better(self, pokemon, other_pokemon): |
There was a problem hiding this comment.
A Pokemon isn't better than other pokemon just because it has higher CP. This function name isn't intuitive.
|
Let's get this pulled in first and then iterate on top of that. |
|
@hahnrobert it's easy to apply this change that I told you. Apply it first, then we merge it. We're walking towards configuration in files, so no need for |
|
@hahnrobert and btw, remember to add the necessary explanation in README. |
| def should_release_pokemon(self, pokemon_name, cp, iv, response_dict): | ||
| # Returns True if pokemon is better than other_pokemon | ||
| def _is_better(self, pokemon, other_pokemon): | ||
| return (pokemon['cp'] >= other_pokemon['cp']) |
There was a problem hiding this comment.
It should be pokemon['cp'] > other_pokemon['cp'] I think, because with = we will have situation like this:
[2016-07-24 23:56:22] [x] Captured Zubat! [CP 52] [IV 0.24]
[2016-07-24 23:56:22] [#] Owning weaker Zubat(52). Replacing it with 52!
[2016-07-24 23:56:23] [#] Weaker Zubat(52) has been exchanged for candy!
[2016-07-24 23:56:23] [x] Captured Zubat! [CP 52]
|
I would like this pull request got merged. :D |
|
I like it too 👍 |
|
Please have the conflicts resolved then open :) |
|
@solderzzc you don't close a PR because it contains merge conflicts. that's counter intuitive. The merge button is disabled anyway as long as there are conflicts but now one can't see them because the PR has been closed. |
Always keep the best pokemon!
Whenever you capture a pokemon which you don't already own, it will be kept instead of transfered.
If you already own a weaker version of said pokemon, the weaker one is transferred. If the newly captured one is weaker, it will be transferred instead.
This change does some refactoring and we certainly want to follow up with changes to cleanup the code a little.