1212 * You should have received a copy of the GNU General Public License
1313 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1414 */
15+
1516package com .pokegoapi .api .map ;
1617
1718import POGOProtos .Map .Fort .FortDataOuterClass .FortData ;
2526import POGOProtos .Networking .Requests .Messages .EncounterMessageOuterClass ;
2627import POGOProtos .Networking .Requests .Messages .FortDetailsMessageOuterClass .FortDetailsMessage ;
2728import POGOProtos .Networking .Requests .Messages .FortSearchMessageOuterClass .FortSearchMessage ;
29+ import POGOProtos .Networking .Requests .Messages .GetMapObjectsMessageOuterClass ;
2830import POGOProtos .Networking .Requests .Messages .GetMapObjectsMessageOuterClass .GetMapObjectsMessage ;
2931import POGOProtos .Networking .Requests .RequestTypeOuterClass ;
3032import POGOProtos .Networking .Responses .CatchPokemonResponseOuterClass .CatchPokemonResponse ;
@@ -97,7 +99,7 @@ public List<CatchablePokemon> getCatchablePokemon() throws LoginFailedException,
9799 catchablePokemons .add (new CatchablePokemon (api , mapPokemon ));
98100 }
99101
100- for (WildPokemonOuterClass .WildPokemon wildPokemon : objects .getWildPokemons ()){
102+ for (WildPokemonOuterClass .WildPokemon wildPokemon : objects .getWildPokemons ()) {
101103 catchablePokemons .add (new CatchablePokemon (api , wildPokemon ));
102104 }
103105
@@ -243,24 +245,22 @@ public MapObjects getMapObjects(List<Long> cellIds, double latitude, double long
243245 * @return MapObjects in the given cells
244246 */
245247 public MapObjects getMapObjects (List <Long > cellIds ) throws LoginFailedException , RemoteServerException {
246- GetMapObjectsMessage .Builder builder = GetMapObjectsMessage .newBuilder ()
248+ GetMapObjectsMessage .Builder builder = GetMapObjectsMessage .newBuilder ();
247249
248- if (useCache && (System .currentTimeMillis () - lastMapUpdate > mapObjectsExpiry )){
250+ if (useCache && (System .currentTimeMillis () - lastMapUpdate > mapObjectsExpiry )) {
249251 lastMapUpdate = 0 ;
250252 cachedMapObjects = new MapObjects (api );
251253 }
252254
253- GetMapObjectsMessageOuterClass . GetMapObjectsMessage . Builder builder = GetMapObjectsMessageOuterClass .GetMapObjectsMessage .newBuilder ()
255+ builder = GetMapObjectsMessageOuterClass .GetMapObjectsMessage .newBuilder ()
254256 .setLatitude (api .getLatitude ())
255257 .setLongitude (api .getLongitude ());
256258
257259 int index = 0 ;
258260 for (Long cellId : cellIds ) {
259261 builder .addCellId (cellId );
260262 long time = 0 ;
261- if (trackUpdate ) {
262- time = lastMapUpdate ;
263- }
263+
264264 builder .addSinceTimestampMs (lastMapUpdate );
265265 index ++;
266266
@@ -295,7 +295,7 @@ public FortType apply(FortData fortData) {
295295 result .addPokestops (groupedForts .get (FortType .CHECKPOINT ));
296296 }
297297
298- if (useCache ){
298+ if (useCache ) {
299299 cachedMapObjects .update (result );
300300 result = cachedMapObjects ;
301301 lastMapUpdate = System .currentTimeMillis ();
@@ -318,8 +318,7 @@ public List<Long> getCellIds(double latitude, double longitude, int width) {
318318
319319 MutableInteger index = new MutableInteger (0 );
320320 MutableInteger jindex = new MutableInteger (0 );
321- MutableInteger i = new MutableInteger (0 );
322- MutableInteger j = new MutableInteger (0 );
321+
323322
324323 int level = cellId .level ();
325324 int size = 1 << (S2CellId .MAX_LEVEL - level );
0 commit comments