Internet Chess ToolKit
v0.2.0

ictk.boardgame.chess
Class Pawn

java.lang.Object
  extended byictk.boardgame.Piece
      extended byictk.boardgame.chess.ChessPiece
          extended byictk.boardgame.chess.Pawn

public class Pawn
extends ChessPiece


Field Summary
static byte INDEX
           
 
Fields inherited from class ictk.boardgame.chess.ChessPiece
BLACK_OFFSET, NULL_PIECE
 
Constructor Summary
Pawn()
           
Pawn(boolean blackness)
           
Pawn(boolean blackness, Square o, ChessBoard _board)
           
 
Method Summary
 boolean hasMoved()
           
 boolean isBlockable(Square target)
           
 boolean isBlockable(Square blocker, ChessPiece target)
          checks to see if another piece may be able to intercede between the piece's origin and destination square
 boolean isLegalAttack(Square target)
          same as isLegalDests except for special moves like castle and pawn moves.
 boolean isPawn()
           
static boolean isPromotionSquare(Square sq, boolean isBlack)
          if the pawn reaches this square will it promote.
 boolean onEnPassantRank()
          is this pawn on the a possible enpassant rank (not the file).
 
Methods inherited from class ictk.boardgame.chess.ChessPiece
dump, getBoard, getGuardSquares, getIndex, getLegalDests, getLineOfSight, getLineOfSight, getLineOfSight, getPinnedBy, getSquare, isBishop, isBlack, isCaptured, isGuarding, isGuarding, isKing, isKnight, isLegalDest, isQueen, isRook, removeLegalDests, setBoard, setCaptured, toChessPiece, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INDEX

public static final byte INDEX
See Also:
Constant Field Values
Constructor Detail

Pawn

public Pawn()

Pawn

public Pawn(boolean blackness)

Pawn

public Pawn(boolean blackness,
            Square o,
            ChessBoard _board)
Method Detail

onEnPassantRank

public boolean onEnPassantRank()
is this pawn on the a possible enpassant rank (not the file).


isBlockable

public boolean isBlockable(Square target)

isBlockable

public boolean isBlockable(Square blocker,
                           ChessPiece target)
Description copied from class: ChessPiece
checks to see if another piece may be able to intercede between the piece's origin and destination square

Overrides:
isBlockable in class ChessPiece
Parameters:
blocker - - the proposed square that can block the attack
target - - the piece under attack
Returns:
true - the blocker intercedes the attack

isLegalAttack

public boolean isLegalAttack(Square target)
Description copied from class: ChessPiece
same as isLegalDests except for special moves like castle and pawn moves.

Overrides:
isLegalAttack in class ChessPiece

hasMoved

public boolean hasMoved()

isPromotionSquare

public static boolean isPromotionSquare(Square sq,
                                        boolean isBlack)
if the pawn reaches this square will it promote. not sure how useful this function is.


isPawn

public boolean isPawn()
Overrides:
isPawn in class ChessPiece

Submit a bug or feature
Visit the Website
Internet Chess ToolKit is licensed under the GPL v2 .