2022-05-08 12:28:50 -07:00

37 lines
944 B
C#

using System.Text.Json;
using System.Text.Json.Serialization;
using View_by_Distance.Shared.Models.Methods;
namespace View_by_Distance.Shared.Models;
public class Location : Properties.ILocation, ILocation
{
protected double _Confidence;
protected int _Bottom;
protected int _Left;
protected int _Right;
protected int _Top;
public double Confidence => _Confidence;
public int Bottom => _Bottom;
public int Left => _Left;
public int Right => _Right;
public int Top => _Top;
[JsonConstructor]
public Location(double confidence, int bottom, int left, int right, int top)
{
_Confidence = confidence;
_Bottom = bottom;
_Left = left;
_Right = right;
_Top = top;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
}