.vscode
ADO2024
ADO2025
Day
Helpers
Models
Exif
Face
FaceEncoding.cs
FaceFile.cs
FacePart.cs
FacePoint.cs
Location.cs
MappingFromPerson.cs
OutputResolution.cs
AppSettings.cs
Birth.cs
Card.cs
Change.cs
Comment.cs
CreatedBy.cs
Death.cs
H2HexColor.cs
H2NoCheckboxes.cs
H2WithCheckboxes.cs
LineNumber.cs
ModifiedBy.cs
Name.cs
NginxFileSystem.cs
PackageJson.cs
Person.cs
VSCodeTasks.cs
Scripts
Server-Management
.editorconfig
.gitignore
.prettierignore
Dockerfile
File-Folder-Helper.csproj
Program.cs
README.md
Worker.cs
docker-compose.yaml
global.json
package-lock.json
package.json
42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace File_Folder_Helper.Models.Face;
|
|
|
|
[method: JsonConstructor]
|
|
public class Location(int bottom, double confidence, int left, int right, int top) : IEquatable<Location>
|
|
{
|
|
|
|
public int Bottom { init; get; } = bottom;
|
|
public double Confidence { init; get; } = confidence;
|
|
public int Left { init; get; } = left;
|
|
public int Right { init; get; } = right;
|
|
public int Top { init; get; } = top;
|
|
|
|
public override bool Equals(object? obj) => Equals(obj as Location);
|
|
|
|
#pragma warning disable IDE0070
|
|
public override int GetHashCode()
|
|
#pragma warning restore IDE0070
|
|
{
|
|
int hashCode = -773114317;
|
|
hashCode = (hashCode * -1521134295) + Bottom.GetHashCode();
|
|
hashCode = (hashCode * -1521134295) + Left.GetHashCode();
|
|
hashCode = (hashCode * -1521134295) + Right.GetHashCode();
|
|
hashCode = (hashCode * -1521134295) + Top.GetHashCode();
|
|
return hashCode;
|
|
}
|
|
|
|
public bool Equals(Location? location)
|
|
{
|
|
return location is not null
|
|
&& Bottom == location.Bottom
|
|
&& Left == location.Left
|
|
&& Right == location.Right
|
|
&& Top == location.Top;
|
|
}
|
|
|
|
public static bool operator ==(Location location1, Location location2) => EqualityComparer<Location>.Default.Equals(location1, location2);
|
|
|
|
public static bool operator !=(Location location1, Location location2) => !(location1 == location2);
|
|
|
|
} |