Skip to content

Commit f91890a

Browse files
authored
Merge pull request #180 from vmarchaud/Development
add method for the incubator
2 parents 3204bb7 + 6178463 commit f91890a

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/main/java/com/pokegoapi/api/inventory/EggIncubator.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.pokegoapi.api.inventory;
1717

1818
import POGOProtos.Inventory.EggIncubatorOuterClass;
19+
import POGOProtos.Inventory.EggIncubatorTypeOuterClass.EggIncubatorType;
1920
import POGOProtos.Networking.Requests.Messages.UseItemEggIncubatorMessageOuterClass.UseItemEggIncubatorMessage;
2021
import POGOProtos.Networking.Requests.RequestTypeOuterClass;
2122
import POGOProtos.Networking.Responses.UseItemEggIncubatorResponseOuterClass.UseItemEggIncubatorResponse;
@@ -86,4 +87,40 @@ public UseItemEggIncubatorResponse.Result hatchEgg(EggPokemon egg)
8687

8788
return response.getResult();
8889
}
90+
91+
/**
92+
* Get incubator id.
93+
*
94+
* @return the id
95+
*/
96+
public String getId() {
97+
return proto.getId();
98+
}
99+
100+
/**
101+
* Get incubator type.
102+
*
103+
* @return EggIncubatorType
104+
*/
105+
public EggIncubatorType getType() {
106+
return proto.getIncubatorType();
107+
}
108+
109+
/**
110+
* Get the target distance for egg to hatch.
111+
*
112+
* @return km distance to hatch the egg
113+
*/
114+
public double getKmTarget() {
115+
return proto.getTargetKmWalked();
116+
}
117+
118+
/**
119+
* Get the current distance walked with this incubator.
120+
*
121+
* @return km walked with an egg
122+
*/
123+
public double getKmWalked() {
124+
return proto.getStartKmWalked();
125+
}
89126
}

0 commit comments

Comments
 (0)