-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch Location Events to use GpsLocation for underlying platform locations add GeoCoordinate remove beacon events and properties +semver: minor
- Loading branch information
1 parent
ec9ea64
commit 7fb357b
Showing
14 changed files
with
242 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
src/Core/Locations/Events/RegionBeaconsConstraintFailedEvent.cs
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
src/Core/Locations/Events/RegionBeaconsConstraintRangedEvent.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
|
||
namespace Rocket.Surgery.Airframe | ||
{ | ||
/// <summary> | ||
/// Represents a coordinate. | ||
/// </summary> | ||
/// <remarks>any of a set of numbers used in specifying the location of a point on a line, on a surface, or in space.</remarks> | ||
public class GeoCoordinate : IEquatable<GeoCoordinate> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="GeoCoordinate"/> class. | ||
/// </summary> | ||
/// <param name="latitude">The latitude value.</param> | ||
/// <param name="longitude">The longitude value.</param> | ||
public GeoCoordinate(double latitude, double longitude) | ||
{ | ||
if (latitude is < -90 or > 90) | ||
{ | ||
throw new ArgumentException($"Invalid latitude value - {latitude}"); | ||
} | ||
|
||
if (longitude is < -180 or > 180) | ||
{ | ||
throw new ArgumentException($"Invalid longitude value - {longitude}"); | ||
} | ||
|
||
Latitude = latitude; | ||
Longitude = longitude; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the latitude of the coordinate. | ||
/// </summary> | ||
public double Latitude { get; } | ||
|
||
/// <summary> | ||
/// Gets the longitude of the coordinate. | ||
/// </summary> | ||
public double Longitude { get; } | ||
|
||
public static bool operator ==(GeoCoordinate? left, GeoCoordinate? right) => Equals(left, right); | ||
|
||
public static bool operator !=(GeoCoordinate? left, GeoCoordinate? right) => !Equals(left, right); | ||
|
||
/// <inheritdoc/> | ||
public override string ToString() => $"Latitude: {Latitude} - Longitude: {Longitude}"; | ||
|
||
/// <inheritdoc/> | ||
public bool Equals(GeoCoordinate? other) => other != null && (Latitude, Longitude).Equals((other.Latitude, other.Longitude)); | ||
|
||
/// <inheritdoc/> | ||
public override bool Equals(object? obj) => obj is GeoCoordinate coordinate && Equals(coordinate); | ||
|
||
/// <inheritdoc/> | ||
public override int GetHashCode() => (Latitude, Longitude).GetHashCode(); | ||
} | ||
} |
Oops, something went wrong.