예제 #1
0
 public void getMapObjects(List<Long> cellIds, double latitude, double longitude) {
   requestHandler.setLatitude(latitude);
   requestHandler.setLongitude(longitude);
   requestHandler.setAltitude(0);
   GetMapObjectsRequest request = new GetMapObjectsRequest(cellIds, latitude, longitude);
   requestHandler.addRequest(request);
   requestHandler.sendRequests();
 }
예제 #2
0
 public FortDetails getFortDetails(String id, long lon, long lat) {
   FortDetailsRequest request = new FortDetailsRequest(id);
   request.setLatitude(lat);
   request.setLongitude(lon);
   requestHandler.addRequest(request);
   requestHandler.sendRequests();
   return new FortDetails(request.getOutput());
 }
예제 #3
0
  public PlayerProfile getPlayerProfile() {

    ProfileRequest pr = new ProfileRequest();
    requestHandler.addRequest(pr);
    requestHandler.sendRequests();

    return pr.getProfile();
  }
예제 #4
0
 private void getInventory() {
   InventoryRequest invRequest = new InventoryRequest();
   invRequest.setTimestamp(lastInventoryUpdate);
   requestHandler.addRequest(invRequest);
   requestHandler.sendRequests();
   for (Pokemon newPokemon : invRequest.getPokemon()) {
     this.pokebank.addPokemon(newPokemon);
   }
 }
예제 #5
0
  public PokemonGo(AuthInfo auth) {
    playerProfile = null;
    // send profile request to get the ball rolling
    requestHandler = new RequestHandler(auth);
    ProfileRequest pr = new ProfileRequest();
    requestHandler.addRequest(pr);
    requestHandler.sendRequests();
    // should have proper end point now.

    pokebank = new PokeBank(this);

    lastInventoryUpdate = 0;
    getInventory();
  }