Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Commit

Permalink
Add a lable for speed displacement on map
Browse files Browse the repository at this point in the history
Add 3 options as checkbox on map
Display routes from google in dash form
  • Loading branch information
Brian committed Aug 21, 2016
1 parent ae7a0d4 commit 2721d27
Show file tree
Hide file tree
Showing 10 changed files with 314 additions and 45 deletions.
11 changes: 11 additions & 0 deletions PokemonGo.RocketBot.Logic/Event/GetHumanizeRouteEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;
using GeoCoordinatePortable;

namespace PokemonGo.RocketBot.Logic.Event
{
public class GetHumanizeRouteEvent : IEvent
{
public GeoCoordinate Destination;
public List<GeoCoordinate> Route;
}
}
10 changes: 10 additions & 0 deletions PokemonGo.RocketBot.Logic/Navigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace PokemonGo.RocketBot.Logic
{
public delegate void UpdatePositionDelegate(double lat, double lng);

public delegate void GetHumanizeRouteDelegate(List<GeoCoordinate> route, GeoCoordinate destination);

public class Navigation
{
private const double SpeedDownTo = 10/3.6;
Expand Down Expand Up @@ -210,6 +212,8 @@ public async Task<PlayerUpdateResponse> Move(GeoCoordinate targetLocation,
foreach (var item in route)
points.Add(new GeoCoordinate(item.ToArray()[1], item.ToArray()[0]));

OnGetHumanizeRouteEvent(points, targetLocation);

for (var i = 0; i < points.Count; i++)
{
var speedInMetersPerSecond = session.LogicSettings.UseWalkingSpeedVariant
Expand Down Expand Up @@ -413,5 +417,11 @@ public async Task<PlayerUpdateResponse> HumanPathWalking(GpxReader.Trkpt trk,
}

public event UpdatePositionDelegate UpdatePositionEvent;
public static event GetHumanizeRouteDelegate GetHumanizeRouteEvent;

protected virtual void OnGetHumanizeRouteEvent(List<GeoCoordinate> route, GeoCoordinate destination)
{
GetHumanizeRouteEvent?.Invoke(route, destination);
}
}
}
22 changes: 18 additions & 4 deletions PokemonGo.RocketBot.Logic/PokemonGo.RocketBot.Logic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="C5, Version=2.4.5947.17248, Culture=neutral, PublicKeyToken=282361b99ded7e8e, processorArchitecture=MSIL">
<HintPath>..\packages\C5.2.4.5947.17249\lib\net45\C5.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CloudFlareUtilities, Version=0.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CloudFlareUtilities.0.2.1-alpha\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\CloudFlareUtilities.dll</HintPath>
<Private>True</Private>
Expand All @@ -65,33 +69,42 @@
<HintPath>..\packages\GMap.NET.WindowsForms.1.7.1\lib\net40\GMap.NET.WindowsForms.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="S2Geometry, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\S2Geometry.1.0.1\lib\portable-net45+wp8+win8\S2Geometry.dll</HintPath>
<HintPath>..\packages\S2Geometry.1.0.3\lib\portable-net45+wp8+win8\S2Geometry.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SocketIoClientDotNet, Version=0.9.13.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SocketIoClientDotNet.0.9.13\lib\net45\SocketIoClientDotNet.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604">
<HintPath>$(SolutionDir)\packages\Google.Protobuf.3.0.0-beta4\lib\net45\Google.Protobuf.dll</HintPath>
<Reference Include="System.Numerics" />
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.0.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="GeoCoordinatePortable">
<HintPath>$(SolutionDir)\packages\GeoCoordinate.1.1.0\lib\portable-net45+wp80+win+wpa81\GeoCoordinatePortable.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="Telegram.Bot, Version=10.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Telegram.Bot.10.3.1\lib\net45\Telegram.Bot.dll</HintPath>
<Private>True</Private>
Expand All @@ -110,6 +123,7 @@
<Compile Include="Event\FortTargetEvent.cs" />
<Compile Include="Event\FortFailedEvent.cs" />
<Compile Include="Event\FortUsedEvent.cs" />
<Compile Include="Event\GetHumanizeRouteEvent.cs" />
<Compile Include="Event\HumanWalkingEvent.cs" />
<Compile Include="Event\InventoryListEvent.cs" />
<Compile Include="Event\ItemRecycledEvent.cs" />
Expand Down
6 changes: 5 additions & 1 deletion PokemonGo.RocketBot.Logic/app.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Expand All @@ -12,4 +13,7 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /></startup></configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
39 changes: 36 additions & 3 deletions PokemonGo.RocketBot.Logic/packages.config
Original file line number Diff line number Diff line change
@@ -1,15 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>

<packages>
<package id="C5" version="2.2.5073.27396" targetFramework="net452" />
<package id="C5" version="2.4.5947.17249" targetFramework="net452" />
<package id="CloudFlareUtilities" version="0.2.1-alpha" targetFramework="net452" />
<package id="EngineIoClientDotNet" version="0.9.22" targetFramework="net452" />
<package id="GeoCoordinate" version="1.1.0" targetFramework="net45" />
<package id="GMap.NET.WindowsForms" version="1.7.1" targetFramework="net452" />
<package id="Google.Protobuf" version="3.0.0-beta4" targetFramework="net45" />
<package id="Google.Protobuf" version="3.0.0" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.NETCore.Platforms" version="1.0.1" targetFramework="net452" />
<package id="NETStandard.Library" version="1.6.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="S2Geometry" version="1.0.1" targetFramework="net452" />
<package id="S2Geometry" version="1.0.3" targetFramework="net452" />
<package id="SocketIoClientDotNet" version="0.9.13" targetFramework="net452" />
<package id="System.Collections" version="4.0.11" targetFramework="net452" />
<package id="System.Collections.Concurrent" version="4.0.12" targetFramework="net452" />
<package id="System.Diagnostics.Debug" version="4.0.11" targetFramework="net452" />
<package id="System.Diagnostics.Tools" version="4.0.1" targetFramework="net452" />
<package id="System.Diagnostics.Tracing" version="4.1.0" targetFramework="net452" />
<package id="System.Globalization" version="4.0.11" targetFramework="net452" />
<package id="System.IO" version="4.1.0" targetFramework="net452" />
<package id="System.IO.Compression" version="4.1.0" targetFramework="net452" />
<package id="System.Linq" version="4.1.0" targetFramework="net452" />
<package id="System.Linq.Expressions" version="4.1.0" targetFramework="net452" />
<package id="System.Net.Http" version="4.1.0" targetFramework="net452" />
<package id="System.Net.Primitives" version="4.0.11" targetFramework="net452" />
<package id="System.ObjectModel" version="4.0.12" targetFramework="net452" />
<package id="System.Reflection" version="4.1.0" targetFramework="net452" />
<package id="System.Reflection.Extensions" version="4.0.1" targetFramework="net452" />
<package id="System.Reflection.Primitives" version="4.0.1" targetFramework="net452" />
<package id="System.Resources.ResourceManager" version="4.0.1" targetFramework="net452" />
<package id="System.Runtime" version="4.1.0" targetFramework="net452" />
<package id="System.Runtime.Extensions" version="4.1.0" targetFramework="net452" />
<package id="System.Runtime.InteropServices" version="4.1.0" targetFramework="net452" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.0.0" targetFramework="net452" />
<package id="System.Runtime.Numerics" version="4.0.1" targetFramework="net452" />
<package id="System.Text.Encoding" version="4.0.11" targetFramework="net452" />
<package id="System.Text.Encoding.Extensions" version="4.0.11" targetFramework="net452" />
<package id="System.Text.RegularExpressions" version="4.1.0" targetFramework="net452" />
<package id="System.Threading" version="4.0.11" targetFramework="net452" />
<package id="System.Threading.Tasks" version="4.0.11" targetFramework="net452" />
<package id="System.Threading.Timer" version="4.0.1" targetFramework="net452" />
<package id="System.Xml.ReaderWriter" version="4.0.11" targetFramework="net452" />
<package id="System.Xml.XDocument" version="4.0.11" targetFramework="net452" />
<package id="Telegram.Bot" version="10.3.1" targetFramework="net452" />
<package id="WebSocket4Net" version="0.14.1" targetFramework="net452" />
</packages>
8 changes: 3 additions & 5 deletions PokemonGo.RocketBot.Window/ConsoleEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using PokemonGo.RocketBot.Logic.Event;
using PokemonGo.RocketBot.Logic.Logging;
using PokemonGo.RocketBot.Logic.State;
using PokemonGo.RocketBot.Window.Forms;
using POGOProtos.Enums;
using POGOProtos.Inventory.Item;
using POGOProtos.Networking.Responses;
Expand All @@ -21,11 +22,8 @@ internal class ConsoleEventListener
private static void HandleEvent(HumanWalkingEvent humanWalkingEvent, ISession session)
{
if (session.LogicSettings.ShowVariantWalking)
Logger.Write(
session.Translation.GetTranslation(TranslationString.HumanWalkingVariant,
humanWalkingEvent.OldWalkingSpeed,
humanWalkingEvent.CurrentWalkingSpeed),
LogLevel.Info, ConsoleColor.DarkCyan);
MainForm.SetSpeedLable("Current Speed: " + Math.Round(humanWalkingEvent.CurrentWalkingSpeed, 2) +
" km/h");
}

private static void HandleEvent(ProfileEvent profileEvent, ISession session)
Expand Down
Loading

0 comments on commit 2721d27

Please sign in to comment.