Merge branch 'dev' of https://github.com/kennyboy55/YJMPD-UWP into dev
This commit is contained in:
@@ -51,6 +51,10 @@ namespace YJMPD_UWP
|
|||||||
{
|
{
|
||||||
if (e.Handled) return;
|
if (e.Handled) return;
|
||||||
|
|
||||||
|
App.Game.MoveToStarted(new BasicGeoposition { Latitude = 51.591403, Longitude = 4.743948 });
|
||||||
|
e.Handled = true;
|
||||||
|
return;
|
||||||
|
|
||||||
if (App.Game.Status == Model.GameHandler.GameStatus.STARTED)
|
if (App.Game.Status == Model.GameHandler.GameStatus.STARTED)
|
||||||
{
|
{
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
|
|||||||
@@ -149,10 +149,10 @@ namespace YJMPD_UWP.Model
|
|||||||
|
|
||||||
public void MoveToStarted(BasicGeoposition bgps)
|
public void MoveToStarted(BasicGeoposition bgps)
|
||||||
{
|
{
|
||||||
App.Navigate(typeof(MatchView));
|
|
||||||
|
|
||||||
Destination = bgps;
|
Destination = bgps;
|
||||||
|
|
||||||
|
App.Navigate(typeof(MatchView));
|
||||||
|
|
||||||
GeofenceMonitor.Current.Geofences.Add(new Geofence("destination", new Geocircle(bgps, 50), MonitoredGeofenceStates.Entered | MonitoredGeofenceStates.Exited, false, TimeSpan.FromSeconds(1)));
|
GeofenceMonitor.Current.Geofences.Add(new Geofence("destination", new Geocircle(bgps, 50), MonitoredGeofenceStates.Entered | MonitoredGeofenceStates.Exited, false, TimeSpan.FromSeconds(1)));
|
||||||
|
|
||||||
UpdateGameStatus(GameStatus.STARTED);
|
UpdateGameStatus(GameStatus.STARTED);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace YJMPD_UWP.ViewModels
|
|||||||
Message = "";
|
Message = "";
|
||||||
Degrees = 0;
|
Degrees = 0;
|
||||||
angle = (int)Util.DegreeBearing(App.Geo.Position.Coordinate.Point.Position, App.Game.Destination);
|
angle = (int)Util.DegreeBearing(App.Geo.Position.Coordinate.Point.Position, App.Game.Destination);
|
||||||
HeadingVisible = false;
|
HeadingVisible = true;
|
||||||
App.Game.OnDestinationEnter += Game_OnDestinationEnter;
|
App.Game.OnDestinationEnter += Game_OnDestinationEnter;
|
||||||
App.Game.OnDestinationLeave += Game_OnDestinationLeave;
|
App.Game.OnDestinationLeave += Game_OnDestinationLeave;
|
||||||
App.Geo.OnPositionUpdate += Geo_OnPositionUpdate;
|
App.Geo.OnPositionUpdate += Geo_OnPositionUpdate;
|
||||||
@@ -31,6 +31,7 @@ namespace YJMPD_UWP.ViewModels
|
|||||||
|
|
||||||
Degrees = (int)(angle + -e.Heading.HeadingMagneticNorth);
|
Degrees = (int)(angle + -e.Heading.HeadingMagneticNorth);
|
||||||
NotifyPropertyChanged(nameof(Degrees));
|
NotifyPropertyChanged(nameof(Degrees));
|
||||||
|
Debug.WriteLine(angle);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +43,10 @@ namespace YJMPD_UWP.ViewModels
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
angle = (int)Util.DegreeBearing(e.Position.Coordinate.Point.Position, App.Game.Destination);
|
angle = (int)Util.DegreeBearing(e.Position.Coordinate.Point.Position, App.Game.Destination);
|
||||||
HeadingVisible = Util.Distance(e.Position.Coordinate.Point.Position, App.Game.Destination) > 500;
|
double b = Util.Distance(e.Position.Coordinate.Point.Position, App.Game.Destination) * 1000;
|
||||||
|
HeadingVisible = (int)b > 250;
|
||||||
|
|
||||||
|
Debug.WriteLine(HeadingVisible + " " + b);
|
||||||
|
|
||||||
NotifyPropertyChanged(nameof(HeadingVisible));
|
NotifyPropertyChanged(nameof(HeadingVisible));
|
||||||
NotifyPropertyChanged(nameof(InvHeadingVisible));
|
NotifyPropertyChanged(nameof(InvHeadingVisible));
|
||||||
|
|||||||
Reference in New Issue
Block a user