This repository has been archived by the owner on Oct 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/Beta-Build'
- Loading branch information
Showing
23 changed files
with
695 additions
and
6,172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using POGOProtos.Data; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace PokemonGo.RocketAPI.Window | ||
{ | ||
public static class Extensions | ||
{ | ||
public static float GetIV(this PokemonData poke) | ||
{ | ||
return (poke.IndividualAttack + poke.IndividualDefense + poke.IndividualStamina) / 45.0f; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using PokemonGo.RocketAPI; | ||
using PokemonGo.RocketAPI.Extensions; | ||
|
||
namespace PokemonGo.RocketAPI.Window | ||
{ | ||
public class LocationManager | ||
{ | ||
private Client client; | ||
private double metersPerMillisecond; | ||
private readonly Client _client; | ||
private readonly double _metersPerMillisecond; | ||
|
||
public LocationManager(Client client, double speed) | ||
{ | ||
this.client = client; | ||
this.metersPerMillisecond = speed / 3600; | ||
this._client = client; | ||
_metersPerMillisecond = speed/3600; | ||
} | ||
|
||
public double getDistance(double lat, double lng) | ||
public double GetDistance(double lat, double lng) | ||
{ | ||
LatLong currentLoc = new LatLong(client.CurrentLatitude, client.CurrentLongitude); | ||
var currentLoc = new LatLong(_client.CurrentLatitude, _client.CurrentLongitude); | ||
return currentLoc.distanceFrom(new LatLong(lat, lng)); | ||
} | ||
|
||
public async Task update(double lat, double lng) | ||
public async Task Update(double lat, double lng) | ||
{ | ||
double waitTime = getDistance(lat, lng) / this.metersPerMillisecond; | ||
await Task.Delay((int)Math.Ceiling(waitTime)); | ||
await client.Player.UpdatePlayerLocation(lat, lng); | ||
var waitTime = GetDistance(lat, lng)/_metersPerMillisecond; | ||
await Task.Delay((int) Math.Ceiling(waitTime)); | ||
await _client.Player.UpdatePlayerLocation(lat, lng); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.