| 36 | import java.util.List; |
| 37 | |
| 38 | public class Gym implements MapPoint { |
| 39 | private FortData proto; |
| 40 | private GetGymDetailsResponse details; |
| 41 | private PokemonGo api; |
| 42 | |
| 43 | /** |
| 44 | * Gym object. |
| 45 | * @param api The api object to use for requests. |
| 46 | * @param proto The FortData to populate the Gym with. |
| 47 | */ |
| 48 | public Gym(PokemonGo api, FortData proto) { |
| 49 | this.api = api; |
| 50 | this.proto = proto; |
| 51 | this.details = null; |
| 52 | } |
| 53 | |
| 54 | public String getId() { |
| 55 | return proto.getId(); |
| 56 | } |
| 57 | |
| 58 | public double getLatitude() { |
| 59 | return proto.getLatitude(); |
| 60 | } |
| 61 | |
| 62 | public double getLongitude() { |
| 63 | return proto.getLongitude(); |
| 64 | } |
| 65 | |
| 66 | public boolean getEnabled() { |
| 67 | return proto.getEnabled(); |
| 68 | } |
| 69 | |
| 70 | public TeamColorOuterClass.TeamColor getOwnedByTeam() { |
| 71 | return proto.getOwnedByTeam(); |
| 72 | } |
| 73 | |
| 74 | public PokemonIdOuterClass.PokemonId getGuardPokemonId() { |
| 75 | return proto.getGuardPokemonId(); |
| 76 | } |
| 77 | |
| 78 | public int getGuardPokemonCp() { |
| 79 | return proto.getGuardPokemonCp(); |
| 80 | } |
| 81 | |
| 82 | public long getPoints() { |
| 83 | return proto.getGymPoints(); |
| 84 | } |
| 85 | |
| 86 | public boolean getIsInBattle() { |
| 87 | return proto.getIsInBattle(); |
| 88 | } |
| 89 | |
| 90 | public boolean isAttackable() throws LoginFailedException, RemoteServerException { |
| 91 | return this.getGymMembers().size() != 0; |
| 92 | } |
| 93 | |
| 94 | public Battle battle(Pokemon[] team) { |
| 95 | return new Battle(api, team, this); |
nothing calls this directly
no outgoing calls
no test coverage detected