Skip to content

add method for the incubator #180

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

Merged
merged 2 commits into from
Jul 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/main/java/com/pokegoapi/api/inventory/EggIncubator.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.pokegoapi.api.inventory;

import POGOProtos.Inventory.EggIncubatorOuterClass;
import POGOProtos.Inventory.EggIncubatorTypeOuterClass.EggIncubatorType;
import POGOProtos.Networking.Requests.Messages.UseItemEggIncubatorMessageOuterClass.UseItemEggIncubatorMessage;
import POGOProtos.Networking.Requests.RequestTypeOuterClass;
import POGOProtos.Networking.Responses.UseItemEggIncubatorResponseOuterClass.UseItemEggIncubatorResponse;
Expand Down Expand Up @@ -86,4 +87,40 @@ public UseItemEggIncubatorResponse.Result hatchEgg(EggPokemon egg)

return response.getResult();
}

/**
* Get incubator id.
*
* @return the id
*/
public String getId() {
return proto.getId();
}

/**
* Get incubator type.
*
* @return EggIncubatorType
*/
public EggIncubatorType getType() {
return proto.getIncubatorType();
}

/**
* Get the target distance for egg to hatch.
*
* @return km distance to hatch the egg
*/
public double getKmTarget() {
return proto.getTargetKmWalked();
}

/**
* Get the current distance walked with this incubator.
*
* @return km walked with an egg
*/
public double getKmWalked() {
return proto.getStartKmWalked();
}
}