-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEntry.cs
37 lines (34 loc) · 886 Bytes
/
Entry.cs
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
namespace WinSudoku
{
/// <summary>
/// Just a triple. Would be a lot easier in Kotlin of Java with lombok.
/// </summary>
internal class Entry
{
public int Row { get; }
public int Col { get; }
public int Num { get; }
internal Entry(int row, int col, int num)
{
this.Row = row;
this.Col = col;
this.Num = num;
}
public override bool Equals(object obj)
{
if ((obj == null) || !GetType().Equals(obj.GetType()))
{
return false;
}
else
{
Entry p = (Entry)obj;
return (Row == p.Row) && (Col == p.Col) && (Num == p.Num);
}
}
public override int GetHashCode()
{
return Row + 7 * Col + 49 * Num;
}
}
}