-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cell.cs
43 lines (36 loc) · 857 Bytes
/
Cell.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
38
39
40
41
42
43
using System;
namespace RotatingWalkInMatrix
{
public class Cell
{
public int X { get; set; }
public int Y { get; set; }
public Cell()
{
this.X = 0;
this.Y = 0;
}
public Cell(int x, int y)
{
this.X = x;
this.Y = y;
}
public override bool Equals(object obj)
{
Cell cell = (Cell)obj;
return this.X == cell.X && this.Y == cell.Y;
}
public static bool operator == (Cell a, Cell b)
{
return a.Equals(b);
}
public static bool operator != (Cell a, Cell b)
{
return !a.Equals(b);
}
public static Cell operator +(Cell a, Cell b)
{
return new Cell(a.X + b.X, a.Y + b.Y);
}
}
}