Kenneth van Ewijk vor 10 Jahren
Ursprung
Commit
75c05ab6ee
3 geänderte Dateien mit 10 neuen und 5 gelöschten Zeilen
  1. 5 0
      YJMPD-UWP/Model/GameHandler.cs
  2. 3 4
      YJMPD-UWP/Model/GeoHandler.cs
  3. 2 1
      YJMPD-UWP/Model/PhotoHandler.cs

+ 5 - 0
YJMPD-UWP/Model/GameHandler.cs

@@ -33,6 +33,7 @@ namespace YJMPD_UWP.Model
         public GameStatus Status { get; private set; }
 
         public List<Player> Players { get; private set; }
+        public BasicGeoposition Destination { get; private set; }
 
         public bool Selected { get; private set; }
 
@@ -73,6 +74,7 @@ namespace YJMPD_UWP.Model
             Players = new List<Player>();
             Status = GameStatus.STOPPED;
             Selected = false;
+            Destination = new BasicGeoposition() { Altitude = -1 };
             App.Photo.OnStatusUpdate += Photo_OnStatusUpdate;
             GeofenceMonitor.Current.GeofenceStateChanged += Current_GeofenceStateChanged;
         }
@@ -149,6 +151,8 @@ namespace YJMPD_UWP.Model
         {
             App.Navigate(typeof(MatchView));
 
+            Destination = bgps;
+
             GeofenceMonitor.Current.Geofences.Add(new Geofence("destination", new Geocircle(bgps, 50), MonitoredGeofenceStates.Entered | MonitoredGeofenceStates.Exited, false, TimeSpan.FromSeconds(1)));
 
             UpdateGameStatus(GameStatus.STARTED);
@@ -171,6 +175,7 @@ namespace YJMPD_UWP.Model
         {
             App.Photo.Reset();
             Selected = false;
+            Destination = new BasicGeoposition() { Altitude = -1 };
             Players.Clear();
             GeofenceMonitor.Current.Geofences.Clear();
             UpdateGamePlayers(null);

+ 3 - 4
YJMPD-UWP/Model/GeoHandler.cs

@@ -85,8 +85,8 @@ namespace YJMPD_UWP.Model
                     geo = new Geolocator
                     {
                         DesiredAccuracy = PositionAccuracy.High,
-                        MovementThreshold = 3
-                        //ReportInterval = 1500
+                        //MovementThreshold = 3
+                        ReportInterval = 1500
                     };
 
                     ClearHistory();
@@ -131,8 +131,7 @@ namespace YJMPD_UWP.Model
 
         private void Geo_PositionChanged(Geolocator sender, PositionChangedEventArgs args)
         {
-
-           UpdatePosition(args.Position);
+            UpdatePosition(args.Position);
 
             if(trackhistory)
                 _history.Add(args.Position);

+ 2 - 1
YJMPD-UWP/Model/PhotoHandler.cs

@@ -25,12 +25,13 @@ namespace YJMPD_UWP.Model
 
         public PhotoHandler()
         {
+            Photo = "ms-appx:///Assets/Error.png";
             Status = PhotoStatus.NOPHOTO;
         }
 
         public void Reset()
         {
-            Photo = null;
+            Photo = "ms-appx:///Assets/Error.png";
             Status = PhotoStatus.NOPHOTO;
         }