use of POGOProtos.Networking.Responses.UseItemXpBoostResponseOuterClass.UseItemXpBoostResponse in project PokeGOAPI-Java by Grover-c13.
the class ItemBag method useLuckyEgg.
/**
* use a lucky egg
*
* @return the xp boost response
* @throws RequestFailedException if an exception occurred while sending requests
*/
public UseItemXpBoostResponse useLuckyEgg() throws RequestFailedException {
UseItemXpBoostMessage xpMsg = UseItemXpBoostMessage.newBuilder().setItemId(ItemId.ITEM_LUCKY_EGG).build();
ServerRequest req = new ServerRequest(RequestType.USE_ITEM_XP_BOOST, xpMsg);
api.requestHandler.sendServerRequests(req, true);
try {
UseItemXpBoostResponse response = UseItemXpBoostResponse.parseFrom(req.getData());
Log.i("Main", "Use incense result: " + response.getResult());
return response;
} catch (InvalidProtocolBufferException e) {
throw new RequestFailedException(e);
}
}
Aggregations