-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMove.cs
More file actions
54 lines (52 loc) · 1.33 KB
/
Move.cs
File metadata and controls
54 lines (52 loc) · 1.33 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
51
52
53
54
namespace ChineseChess
{
[Serializable]
public class Move
{
#region Fields
private readonly int startRow;
private readonly int startColumn;
private readonly int endRow;
private readonly int endColumn;
private readonly Piece piece;
private readonly Piece? capturedPiece;
#endregion
#region Properties
public int StartRow
{
get { return startRow; }
}
public int StartColumn
{
get { return startColumn; }
}
public int EndRow
{
get { return endRow; }
}
public int EndColumn
{
get { return endColumn; }
}
public Piece Piece
{
get { return piece; }
}
public Piece? CapturedPiece
{
get { return capturedPiece; }
}
#endregion
#region Constructor
public Move(int startRow, int startColumn, int endRow, int endColumn, Piece piece, Piece? capturedPiece = null)
{
this.startRow = startRow;
this.startColumn = startColumn;
this.endRow = endRow;
this.endColumn = endColumn;
this.piece = piece;
this.capturedPiece = capturedPiece;
}
#endregion
}
}