Init
This commit is contained in:
37
Shared/Models/Location.cs
Normal file
37
Shared/Models/Location.cs
Normal file
@ -0,0 +1,37 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user