|
Class Castle
java.lang.Object
|
+----Chesspiece
|
+----Castle
-
public class Castle
-
extends Chesspiece
-
Castle(Chessboard,
boolean, int, int)
-
Default constructor
-
HaveMoved()
-
Check and see if rook has moved
-
Moved()
-
Tells the king he has castled or given up castling rights Overridden in
King.java
-
TellMeWhereIAm(int,
int)
-
Tells the pieces its new location after moving
-
ValidMove(int,
int, boolean, Chesspiece[][])
-
Validates a given position
Castle
public Castle(Chessboard Board,
boolean BeBlack,
int Row,
int Col)
-
Default constructor
TellMeWhereIAm
public void TellMeWhereIAm(int Col,
int Row)
-
Tells the pieces its new location after moving
-
Parameters:
-
Col - column coordinate
-
Row - row coordinate
-
Overrides:
-
TellMeWhereIAm in
class Chesspiece
HaveMoved
public boolean HaveMoved()
-
Check and see if rook has moved
-
Returns:
-
true if rook has moved yet ( used for castling )
-
Overrides:
-
HaveMoved in class Chesspiece
Moved
public void Moved()
-
Tells the king he has castled or given up castling rights Overridden in
King.java
-
Overrides:
-
Moved in class Chesspiece
ValidMove
public boolean ValidMove(int X,
int Y,
boolean Taking,
Chesspiece Board[][])
-
Validates a given position
-
Parameters:
-
X - x-coordinate of move
-
Y - y-coordinate of move
-
Taking - true if we are capturing opponent's piece
-
Board - the chessboard currently in play
-
Returns:
-
true if move is valid
-
Overrides:
-
ValidMove
in class Chesspiece
|