public GoogleWalk(GoogleResult googleResult) { if (googleResult.Directions.routes == null) { throw new ArgumentException("Invalid google route."); } var route = googleResult.Directions.routes.First(); Waypoints = new List <GeoCoordinate>(); // In some cases, player are inside build Waypoints.Add(googleResult.Origin); Waypoints.Add(new GeoCoordinate(route.legs.First().start_location.lat, route.legs.First().start_location.lng)); Waypoints.AddRange(route.overview_polyline.DecodePoly()); Waypoints.Add(new GeoCoordinate(route.legs.Last().end_location.lat, route.legs.Last().end_location.lng)); // In some cases, player need to get inside a build Waypoints.Add(googleResult.Destiny); }
public static GoogleWalk Get(GoogleResult googleResult) { return(new GoogleWalk(googleResult)); }