private bool useStopNotStation; // False if open from journey/departure window. private void SetMapScope(IEnumerable <StopsBasic.StopBasic> stops, bool zoomAtCurrentLoc = true, bool adaptiveZoom = false) { double lat, lon, distance; var loc = new Utilities.Position(double.NaN, double.NaN); try { loc = AsyncHelpers.RunSync(DataFeedClient.GeoWatcher.GetCurrentPosition); } catch { zoomAtCurrentLoc = false; PlatformDependentSettings.ShowMessage(Settings.Localization.PositioningNeeded); } if (!zoomAtCurrentLoc || double.IsNaN(loc.Latitude) || double.IsNaN(loc.Longitude)) { lat = stops.GetAverageLatitude(); lon = stops.GetAverageLongitude(); distance = adaptiveZoom ? 10000 : 1000; } else { lat = loc.Latitude; lon = loc.Longitude; distance = 350; } map.MoveToRegion(MapSpan.FromCenterAndRadius(new Xamarin.Forms.GoogleMaps.Position(lat, lon), new Distance(distance)), false); }
public ChessModel ModelAt(Utilities.Position pos) { //the method passes through all models and check their position for (int i = 0; i < 32; i++) { if (models[i].Position() == pos && models[i].IsCaptured() == false) //avoid shadow-worrier bug { return(models[i]); } } return(null); }
public bool CheckerHasModel(Utilities.Position checkerPosition) { for (int i = 0; i < 32; i++) { if (models[i].Position() == checkerPosition) { if (models[i].IsCaptured() == false) { return(true); } } } return(false); }
public Checker CheckerAt(Utilities.Position pos) { return(checkers[pos.x, pos.y, pos.z]); }