maintenance work, basically …

This commit is contained in:
alterNERDtive 2022-01-20 16:10:10 +01:00
parent c2f5cf3b0c
commit 8cfea2474c
6 changed files with 44 additions and 12 deletions

7
.editorconfig Normal file
View file

@ -0,0 +1,7 @@
[*.cs]
# IDE0021: Use block body for constructors
csharp_style_expression_bodied_constructors = when_on_single_line
# IDE0024: Use block body for operators
csharp_style_expression_bodied_operators = when_on_single_line

View file

@ -15,6 +15,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EDTS", "EDTS\EDTS.csproj",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6155D836-CDE8-41B8-A12A-7628E6BA20DE}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.build.props = Directory.build.props
stylecop.json = stylecop.json
EndProjectSection

View file

@ -29,6 +29,7 @@
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="..\glider.jpg">
<Pack>True</Pack>
<PackagePath></PackagePath>
@ -41,7 +42,7 @@
<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
</ItemGroup>
</Target>

View file

@ -40,9 +40,7 @@ namespace alterNERDtive.Edna
/// <param name="z">The z coordinate.</param>
/// <param name="precision">The available precision.</param>
public Location(double x, double y, double z, int precision)
{
(this.X, this.Y, this.Z, this.Precision) = (x, y, z, precision);
}
=> (this.X, this.Y, this.Z, this.Precision) = (x, y, z, precision);
/// <summary>
/// Initializes a new instance of the <see cref="Location"/> struct.
@ -51,9 +49,14 @@ namespace alterNERDtive.Edna
/// <param name="y">The y coordinate.</param>
/// <param name="z">The z coordinate.</param>
public Location(double x, double y, double z)
{
(this.X, this.Y, this.Z, this.Precision) = (x, y, z, 0);
}
=> (this.X, this.Y, this.Z, this.Precision) = (x, y, z, 0);
/// <summary>
/// Initializes a new instance of the <see cref="Location"/> struct.
/// </summary>
/// <param name="location">An EDTS Location to convert.</param>
public Location(Edts.Location location)
=> (this.X, this.Y, this.Z, this.Precision) = (location.X, location.Y, location.Z, location.Precision);
/// <summary>
/// Gets the x coordinate.
@ -99,9 +102,9 @@ namespace alterNERDtive.Edna
/// <returns>The distance between both locations.</returns>
public Distance DistanceTo(Location location)
{
if (this == location)
if (this == location && this.Precision == 0)
{
return new Distance(value: 0, precision: 0);
return new Distance(value: 0);
}
else
{
@ -137,8 +140,8 @@ namespace alterNERDtive.Edna
/// </summary>
/// <param name="value">The distance, with absolute precision.</param>
public Distance(double value)
: this(value: value, precision: 0)
{
(this.Value, this.Precision) = (value, 0);
}
/// <summary>

View file

@ -61,7 +61,7 @@ namespace alterNERDtive.Edna
/// <summary>
/// Gets the systems Location in the galaxy.
/// </summary>
public new Location Coordinates { get; private set; }
public new Location Coordinates { get => throw new NotImplementedException(); }
/// <summary>
/// Finds a star system by name.

View file

@ -1,4 +1,23 @@
using System;
// <copyright file="EdsmApi.cs" company="alterNERDtive">
// Copyright 2021 alterNERDtive.
//
// This file is part of EDNA.
//
// EDNA is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// EDNA is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with EDNA. If not, see &lt;https://www.gnu.org/licenses/&gt;.
// </copyright>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +27,6 @@ namespace EDSM
{
public class EdsmApi
{
private readonly string url = "https://www.edsm.net/api-";
}
}