Moved more to Map library
This commit is contained in:
49
Shared/Models/Mapping.cs
Normal file
49
Shared/Models/Mapping.cs
Normal file
@ -0,0 +1,49 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public class Mapping : Properties.IMapping
|
||||
{
|
||||
|
||||
protected readonly int? _ApproximateYears;
|
||||
protected readonly string _DisplayDirectoryName;
|
||||
protected bool? _Filtered;
|
||||
protected readonly int? _NormalizedPixelPercentage;
|
||||
protected readonly PersonBirthday _PersonBirthday;
|
||||
protected readonly string _PersonKey;
|
||||
public int? ApproximateYears => _ApproximateYears;
|
||||
public string DisplayDirectoryName => _DisplayDirectoryName;
|
||||
public bool? Filtered => _Filtered;
|
||||
public int? NormalizedPixelPercentage => _NormalizedPixelPercentage;
|
||||
public PersonBirthday PersonBirthday => _PersonBirthday;
|
||||
public string PersonKey => _PersonKey;
|
||||
|
||||
[JsonConstructor]
|
||||
public Mapping(int? approximateYears, string displayDirectoryName, bool? filtered, int? normalizedPixelPercentage, PersonBirthday personBirthday, string personKey)
|
||||
{
|
||||
_ApproximateYears = approximateYears;
|
||||
_DisplayDirectoryName = displayDirectoryName;
|
||||
_Filtered = filtered;
|
||||
_NormalizedPixelPercentage = normalizedPixelPercentage;
|
||||
_PersonBirthday = personBirthday;
|
||||
_PersonKey = personKey;
|
||||
}
|
||||
|
||||
public Mapping(int? approximateYears, string displayDirectoryName, int? normalizedPixelPercentage, PersonBirthday personBirthday, string personKey) :
|
||||
this(approximateYears, displayDirectoryName, null, normalizedPixelPercentage, personBirthday, personKey)
|
||||
{ }
|
||||
|
||||
public Mapping(int? approximateYears, string displayDirectoryName, PersonBirthday personBirthday, string personKey) :
|
||||
this(approximateYears, displayDirectoryName, null, null, personBirthday, personKey)
|
||||
{ }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
public void SetFiltered() => _Filtered = true;
|
||||
|
||||
}
|
Reference in New Issue
Block a user