Re-write
This commit is contained in:
42
Shared/Models/DistanceHolder.cs
Normal file
42
Shared/Models/DistanceHolder.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public class DistanceHolder : Properties.IDistanceHolder
|
||||
{
|
||||
|
||||
public Face Face { init; get; }
|
||||
public FileHolder FileHolder { init; get; }
|
||||
public int Id { init; get; }
|
||||
public string JSONDirectory { init; get; }
|
||||
public Location? Location { init; get; }
|
||||
public string TSVDirectory { init; get; }
|
||||
public double Sort { get; set; }
|
||||
|
||||
[JsonConstructor]
|
||||
public DistanceHolder(
|
||||
Face face,
|
||||
FileHolder fileHolder,
|
||||
int id,
|
||||
string jsonDirectory,
|
||||
Location? location,
|
||||
string tsvDirectory
|
||||
)
|
||||
{
|
||||
FileHolder = fileHolder;
|
||||
Sort = double.MaxValue;
|
||||
Face = face;
|
||||
Id = id;
|
||||
JSONDirectory = jsonDirectory;
|
||||
Location = location;
|
||||
TSVDirectory = tsvDirectory;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user