-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathKnight.java
More file actions
27 lines (25 loc) · 717 Bytes
/
Knight.java
File metadata and controls
27 lines (25 loc) · 717 Bytes
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
public class Knight extends Piece
{
public Knight(boolean color)
{
//this calls the constructor of Piece
super(color);
}
protected MoveList[] getPieceMoves()
{
MoveList[] m =
{
MoveList.KNIGHT_LEFT_UP,
MoveList.KNIGHT_UP_LEFT,
MoveList.KNIGHT_UP_RIGHT,
MoveList.KNIGHT_RIGHT_UP,
MoveList.KNIGHT_RIGHT_DOWN,
MoveList.KNIGHT_DOWN_RIGHT,
MoveList.KNIGHT_DOWN_LEFT,
MoveList.KNIGHT_LEFT_DOWN
};
return m;
}
protected boolean usesSingleMove(){return true;}
protected String getName(){return "knight";}
}