private async void ProcessMockLocation(TollRoad getTollRoad) { await Task.Delay(20000); IsBound = true; foreach (var road in getTollRoad.WayPoints) { if (isStartLocation) { foreach (var point in road.TollPoints) { if (isStartLocation) { //if (point.WaypointAction == SettingsService.waypointAction) //{ Location = new GeoLocation() { Latitude = point.Latitude, Longitude = point.Longitude, TollPointId = point.Id }; //updateAgain = false; //return; //} #if DEBUG await Task.Delay(point.Interval); #elif REALEASE await Task.Delay(20000); #endif } } } } }
/// <summary> /// Creates a new toll cost for the given location that is inputted. If the player has enough monies and says YES the /// location will be inserted into the trail, otherwise all the data will be destroyed and prompt returned to the fork /// in the road where the toll probably came from. /// </summary> /// <param name="tollRoad">Location that is going to cost the player money in order to use the path to travel to it.</param> public void GenerateToll(TollRoad tollRoad) { if (Toll != null) { return; } Toll = new TollGenerator(tollRoad); }
public TollRoad MockTollRoad(string fileName) { List <TollPoint> tollPoints; var assembly = typeof(StatesData).GetTypeInfo().Assembly; Stream stream = assembly.GetManifestResourceStream(fileName); using (var reader = new System.IO.StreamReader(stream)) { string json = reader.ReadToEnd(); tollPoints = JsonConvert.DeserializeObject <List <TollPoint> >(json); } var tollRoad = new TollRoad("Minskiy Area - Glorium", tollPoints) { Id = "584a4b53f44d57dc336998ca" }; return(tollRoad); }
/// <summary> /// Initializes a new instance of the <see cref="T:OregonTrailDotNet.Window.Travel.Toll.TollGenerator" /> class. /// </summary> /// <param name="tollRoad">Location that is going to cost the player money in order to use the path to travel to it.</param> public TollGenerator(TollRoad tollRoad) { Cost = GameSimulationApp.Instance.Random.Next(1, 13); Road = tollRoad; }