Skip to content

Commit

Permalink
Merge pull request #330 from atc-net/feature/Improve-CartesianCoordin…
Browse files Browse the repository at this point in the history
…ate-serialization

Feature/improve cartesian coordinate serialization
  • Loading branch information
davidkallesen authored Oct 7, 2024
2 parents 3ceb5cc + 92c77e3 commit 4abfdba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
14 changes: 12 additions & 2 deletions docs/CodeDoc/Atc/Atc.Factories.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@ Provides factory methods for creating instances of `System.Collections.Generic.I
### Static Methods
#### EmptyAsyncEnumerable
#### Empty
>```csharp
>IAsyncEnumerable<T> EmptyAsyncEnumerable()
>IAsyncEnumerable<T> Empty()
>```
><b>Summary:</b> Returns an empty `System.Collections.Generic.IAsyncEnumerable`1`.
>
><b>Returns:</b> An empty `System.Collections.Generic.IAsyncEnumerable`1`.
#### FromSingleItem
>```csharp
>IAsyncEnumerable<T> FromSingleItem(T item)
>```
><b>Summary:</b> Converts a single item into an `System.Collections.Generic.IAsyncEnumerable`1`.
>
><b>Parameters:</b><br>
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`item`&nbsp;&nbsp;-&nbsp;&nbsp;The item to convert.<br />
>
><b>Returns:</b> An `System.Collections.Generic.IAsyncEnumerable`1` containing the single item.
<hr /><div style='text-align: right'><i>Generated by MarkdownCodeDoc version 1.2</i></div>
3 changes: 2 additions & 1 deletion docs/CodeDoc/Atc/IndexExtended.md
Original file line number Diff line number Diff line change
Expand Up @@ -4395,7 +4395,8 @@

- [AsyncEnumerableFactory](Atc.Factories.md#asyncenumerablefactory)
- Static Methods
- EmptyAsyncEnumerable()
- Empty()
- FromSingleItem(T item)

## [Atc.Helpers](Atc.Helpers.md)

Expand Down
4 changes: 3 additions & 1 deletion src/Atc/Structs/CartesianCoordinate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public record struct CartesianCoordinate(double Latitude = 0, double Longitude =
/// <value>
/// <c>true</c> if this instance is default; otherwise, <c>false</c>.
/// </value>
[JsonIgnore]
public readonly bool IsDefault => Latitude.IsEqual(0) && Longitude.IsEqual(0);

/// <summary>
Expand All @@ -23,8 +24,9 @@ public readonly bool Equals(CartesianCoordinate other) =>
Latitude.AreClose(other.Latitude) &&
Longitude.AreClose(other.Longitude);

/// <inheritdoc />
public override readonly int GetHashCode()
=> base.GetHashCode();
=> HashCode.Combine(Latitude, Longitude);

/// <inheritdoc />
public override readonly string ToString()
Expand Down

0 comments on commit 4abfdba

Please sign in to comment.