-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCell.cs
46 lines (39 loc) · 835 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
44
45
46
using System;
using System.Collections.Generic;
using System.Text;
namespace ChessExample
{
public struct Cell
{
public static readonly Cell INVALID_CELL = new Cell(-1, -1);
private int row;
private int col;
public int Row
{
get
{
return row;
}
}
public int Col
{
get
{
return col;
}
}
public bool Valid
{
get
{
return row >= 0 && row < 8 && col >= 0 && col < 8;
}
}
public Cell(int row, int col)
{
this.row = row;
this.col = col;
}
public override string ToString() => "[" + row + ", " + col + "]";
}
}