mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 10:36:30 +01:00
28 lines
838 B
C#
28 lines
838 B
C#
|
using System;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using TINK.Model.Device;
|
|||
|
using Xamarin.Essentials;
|
|||
|
|
|||
|
namespace TINK.Model.Services.Geolocation
|
|||
|
{
|
|||
|
public class SimulatedGeolocationService : IGeolocation
|
|||
|
{
|
|||
|
private IGeolodationDependent Dependent { get; }
|
|||
|
|
|||
|
public SimulatedGeolocationService(IGeolodationDependent dependent)
|
|||
|
{
|
|||
|
Dependent = dependent;
|
|||
|
}
|
|||
|
|
|||
|
public async Task<Location> GetAsync(DateTime? timeStamp = null)
|
|||
|
{
|
|||
|
return await Task.FromResult(new Location(47.976634, 7.825490) { Accuracy = 0, Timestamp = timeStamp ?? DateTime.Now }); ;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary> If true location data returned is simulated.</summary>
|
|||
|
public bool IsSimulation { get => true; }
|
|||
|
|
|||
|
public bool IsGeolcationEnabled => Dependent.IsGeolcationEnabled;
|
|||
|
}
|
|||
|
}
|