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

Number of Gyms conquered? #117

Open
Spettacolo83 opened this issue Aug 17, 2016 · 5 comments
Open

Number of Gyms conquered? #117

Spettacolo83 opened this issue Aug 17, 2016 · 5 comments

Comments

@Spettacolo83
Copy link

Do you know if I can get the number of the current gyms conquered?
Thank you very much!

@NicklasWallgren
Copy link
Owner

NicklasWallgren commented Aug 19, 2016

What do you mean by "current" gyms conquered? As in gyms you currently defend?

* @method int getBattleAttackWon()
* @method int getBattleAttackTotal()
* @method int getBattleDefendedWon()
* @method int getBattleTrainingWon()
* @method int getBattleTrainingTotal()

@Ni42
Copy link
Collaborator

Ni42 commented Aug 19, 2016

Those methods are global stats. He is probably looking for the number that shows in game on the shop that decides how many pokecoins you can get if you claim them now. It might be somewhere under the "DailyDefenderBonus" protos, but I can't pinpoint it right now ...

@Spettacolo83
Copy link
Author

Yes @Ni42 exactly!

@NicklasWallgren
Copy link
Owner

One way of achieving it, probably not the best way.

$deployedPokemons = $pokebank->getPokemons()->filter(function (Pokemon $pokemon) {
    return $pokemon->isDeployed();
});

$numberOfDeployedPokemons = count($deployedPokemons);

@Spettacolo83
Copy link
Author

I tried it but does not work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants