forked from austinvaness/CameraLCD
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplayId.cs
More file actions
50 lines (42 loc) · 1.21 KB
/
DisplayId.cs
File metadata and controls
50 lines (42 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
namespace avaness.CameraLCD
{
public struct DisplayId : IEquatable<DisplayId>
{
public long EntityId;
public int Area;
public DisplayId(long entityId, int area)
{
EntityId = entityId;
Area = area;
}
public override bool Equals(object obj)
{
return obj is DisplayId id && Equals(id);
}
public bool Equals(DisplayId other)
{
return EntityId == other.EntityId &&
Area == other.Area;
}
public override int GetHashCode()
{
int hashCode = -1120748461;
hashCode = hashCode * -1521134295 + EntityId.GetHashCode();
hashCode = hashCode * -1521134295 + Area.GetHashCode();
return hashCode;
}
public static bool operator ==(DisplayId left, DisplayId right)
{
return left.Equals(right);
}
public static bool operator !=(DisplayId left, DisplayId right)
{
return !(left == right);
}
public override string ToString()
{
return "{EntityId: " + EntityId + ", Area: " + Area + "}";
}
}
}