Ejemplo n.º 1
0
        private static async Task ActionsWhenTravelToSnipeTarget(ISession session, CancellationToken cancellationToken,
                                                                 SnipePokemonInfo pokemon, bool allowCatchPokemon, bool allowSpinPokeStop)
        {
            var distance = LocationUtils.CalculateDistanceInMeters(
                pokemon.Latitude,
                pokemon.Longitude,
                session.Client.CurrentLatitude,
                session.Client.CurrentLongitude
                );

            if (allowCatchPokemon && distance > 50.0)
            {
                // Catch normal map Pokemon
                await CatchNearbyPokemonsTask.Execute(session, cancellationToken, sessionAllowTransfer : false);
            }
            if (allowSpinPokeStop)
            {
                //looking for neaby pokestop. spin it
                await UseNearbyPokestopsTask.SpinPokestopNearBy(session, cancellationToken, null);
            }
            if (session.LogicSettings.ActivateMSniper)
            {
                await MSniperServiceTask.Execute(session, cancellationToken);
            }
        }
Ejemplo n.º 2
0
 private static async Task WalkingBackGPXPath(ISession session, CancellationToken cancellationToken, FortData originalPokestop)
 {
     var destination = new GeoCoordinate(originalPokestop.Latitude, originalPokestop.Longitude,
                                         LocationUtils.getElevation(session, originalPokestop.Latitude, originalPokestop.Longitude));
     await session.Navigation.Move(destination,
                                   async() =>
     {
         await CatchNearbyPokemonsTask.Execute(session, cancellationToken);
         await UseNearbyPokestopsTask.SpinPokestopNearBy(session, cancellationToken);
     },
                                   session,
                                   cancellationToken);
 }
Ejemplo n.º 3
0
 private static async Task WalkingBackGPXPath(ISession session, CancellationToken cancellationToken, FortData originalPokestop, FortDetailsResponse fortInfo)
 {
     var destination = new FortLocation(originalPokestop.Latitude, originalPokestop.Longitude,
                                        LocationUtils.getElevation(session.ElevationService, originalPokestop.Latitude, originalPokestop.Longitude), originalPokestop, fortInfo);
     await session.Navigation.Move(destination,
                                   async() =>
     {
         await MSniperServiceTask.Execute(session, cancellationToken);
         await CatchNearbyPokemonsTask.Execute(session, cancellationToken);
         await UseNearbyPokestopsTask.SpinPokestopNearBy(session, cancellationToken);
     },
                                   session,
                                   cancellationToken);
 }
Ejemplo n.º 4
0
 private static async Task WalkingBackGPXPath(ISession session, CancellationToken cancellationToken, FortData originalPokestop)
 {
     var destination = new FortLocation(originalPokestop.Latitude, originalPokestop.Longitude,
                                        LocationUtils.getElevation(session, originalPokestop.Latitude, originalPokestop.Longitude), originalPokestop, null);
     await session.Navigation.Move(destination,
                                   async() =>
     {
         if (session.LogicSettings.ActivateMSniper)
         {
             await MSniperServiceTask.Execute(session, cancellationToken);
         }
         await CatchNearbyPokemonsTask.Execute(session, cancellationToken);
         await UseNearbyPokestopsTask.SpinPokestopNearBy(session, cancellationToken);
     },
                                   session,
                                   cancellationToken);
 }