MCPcopy Index your code
hub / github.com/Grover-c13/PokeGOAPI-Java / Gym

Class Gym

src/main/java/com/pokegoapi/api/gym/Gym.java:38–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36import java.util.List;
37
38public 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);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected