|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webstersmalley.chessweb.model.Piece
public abstract class Piece
Represents an individual chess piece.
Field Summary | |
---|---|
static Piece[] |
ALL_PIECES
All the Pieces - used for iterating. |
static Piece |
BLACK_BISHOP
Black Bishop Piece. |
static Piece |
BLACK_KING
Black King Piece. |
static Piece |
BLACK_KNIGHT
Black Knight Piece. |
static Piece |
BLACK_PAWN
Black Pawn Piece. |
static Piece |
BLACK_QUEEN
Black Queen Piece. |
static Piece |
BLACK_ROOK
Black Rook Piece. |
static Piece |
WHITE_BISHOP
White Bishop Piece. |
static Piece |
WHITE_KING
White King Piece. |
static Piece |
WHITE_KNIGHT
White Knight Piece. |
static Piece |
WHITE_PAWN
White Pawn Piece. |
static Piece |
WHITE_QUEEN
White Queen Piece. |
static Piece |
WHITE_ROOK
White Rook Piece. |
Constructor Summary | |
---|---|
Piece(Team team)
Constructs a new Piece. |
Method Summary | |
---|---|
java.lang.String |
getIcon()
Returns the htmlName. |
java.lang.String |
getName()
Get the name of this piece. |
java.lang.String |
getStartingPositions()
Returns the starting positions. |
Team |
getTeam()
|
boolean |
isJumper()
|
boolean |
moveIsATake(Position destination,
Board board)
Whether the proposed move is a take. |
void |
setJumper(boolean jumper)
|
void |
setStartingPositions(java.lang.String startingPositions)
Sets the startign positions. |
void |
setTeam(Team team)
|
abstract void |
validateDirection(Move move,
Board board)
Validate a direction. |
void |
validateMove(Move move,
Board board)
Validate a move. |
void |
validateTake(Move move,
Board board)
Validate a take. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Piece WHITE_BISHOP
public static final Piece BLACK_BISHOP
public static final Piece WHITE_KING
public static final Piece BLACK_KING
public static final Piece WHITE_KNIGHT
public static final Piece BLACK_KNIGHT
public static final Piece WHITE_PAWN
public static final Piece BLACK_PAWN
public static final Piece WHITE_QUEEN
public static final Piece BLACK_QUEEN
public static final Piece WHITE_ROOK
public static final Piece BLACK_ROOK
public static final Piece[] ALL_PIECES
Constructor Detail |
---|
public Piece(Team team)
team
- the team.Method Detail |
---|
public final java.lang.String getIcon()
public final java.lang.String getStartingPositions()
public final void setStartingPositions(java.lang.String startingPositions)
startingPositions
- the starting positions.public final Team getTeam()
public final void setTeam(Team team)
team
- The team to set.public final java.lang.String getName()
public final void validateMove(Move move, Board board) throws InvalidMoveException
move
- the moveboard
- the board
InvalidMoveException
- if the move is invalid.public abstract void validateDirection(Move move, Board board) throws InvalidMoveException
board
- the boardmove
- the move
InvalidMoveException
- if the move is invalid.public final void validateTake(Move move, Board board) throws InvalidMoveException
move
- the moveboard
- the board
InvalidMoveException
- if the move is invalid.public final boolean moveIsATake(Position destination, Board board)
destination
- the destination position.board
- the board
public final boolean isJumper()
public final void setJumper(boolean jumper)
jumper
- The jumper to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |