Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

antichess
Class Pawn  view Pawn download Pawn.java

java.lang.Object
  extended byantichess.Piece
      extended byantichess.Pawn

public class Pawn
extends Piece

A Pawn piece in antichess.


Field Summary
 
Fields inherited from class antichess.Piece
BISHOP, BLACK, BLUE, dcol, drow, EMPTY, FIRSTCOLOR, FIRSTPIECE, KING, KNIGHT, LASTCOLOR, LASTPIECE, offsets, PAWN, PIECECOUNT, PIECEVALUE, playerColorString, QUEEN, RED, ROOK, slide, WHITE
 
Constructor Summary
Pawn(char letter, Board b, int col, int row, int color)
          Creates a new piece.
 
Method Summary
 Piece copyPiece(Board b)
          Creates a copy to a new board
private  java.util.List getCaptureMoves()
          Returns a list of possible capture (not necessarily legal) moves for a Pawn The Moves are not necessarily legal.
private  java.util.List getNonCaptureMoves()
          Returns a list of possible noncapture (not necessarily legal) moves for a Pawn The Moves are not necessarily legal.
 void getNormalMoves(java.util.List captureMoves, java.util.List nonCaptureMoves)
          Overrides Piece.getNormalMoves
 void makeCaptureMove(Move move)
          Makes a capture move & checks if it is also a promotion.
private  void makeEpMove(Move move)
          Makes an en passant capture
 void makeOtherMove(Move move)
          Overrides Piece.makeOtherMove.
private  void makePromoteMove(Move move)
          Makes a noncapture promotion
 void undoCaptureMove(Move move)
          undos a normal pawn capture move /* * Overrides Piece.undoCaptureMove.
private  void undoEpMove(Move move)
          Undos en passant Move
 void undoOtherMove(Move move)
          Overrides Piece.undoOtherMove
 
Methods inherited from class antichess.Piece
addEmpty, canAttackLocation, equals, equals, getAllValidMoves, getBoard, getChar, getCol, getColor, getLastCol, getLastRow, getMoved, getOpponentColor, getOpponentColor, getOtherMoves, getRow, getStandardValidMoves, getSwitchMoves, getType, getValidMoves, getValidMovesNormalChess, isGameOver, isGameOver, isGameOverNormalChess, isLoseNormalChess, isTie, isTie, isTieNormalChess, isValidMove, isWin, isWin, kingInCheck, makeGeneratedMove, makeGeneratedMove, makeMove, makeMove, makeMove, makeMove, setBoard, setColor, setLastLocation, setLocation, setMoved, swapPieces, toString, undoMove
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pawn

public Pawn(char letter,
            Board b,
            int col,
            int row,
            int color)
Creates a new piece.

Method Detail

copyPiece

public Piece copyPiece(Board b)
Creates a copy to a new board

Overrides:
copyPiece in class Piece

getNormalMoves

public void getNormalMoves(java.util.List captureMoves,
                           java.util.List nonCaptureMoves)
Overrides Piece.getNormalMoves

Overrides:
getNormalMoves in class Piece

getNonCaptureMoves

private java.util.List getNonCaptureMoves()
Returns a list of possible noncapture (not necessarily legal) moves for a Pawn The Moves are not necessarily legal. Calling code should use inCheck after making a move.


getCaptureMoves

private java.util.List getCaptureMoves()
Returns a list of possible capture (not necessarily legal) moves for a Pawn The Moves are not necessarily legal. Calling code should use inCheck after making a move.


makeOtherMove

public void makeOtherMove(Move move)
Overrides Piece.makeOtherMove. Implements 2-step pass or En Passant or Promotion

Overrides:
makeOtherMove in class Piece

undoOtherMove

public void undoOtherMove(Move move)
Overrides Piece.undoOtherMove

Overrides:
undoOtherMove in class Piece

makeEpMove

private void makeEpMove(Move move)
Makes an en passant capture


undoEpMove

private void undoEpMove(Move move)
Undos en passant Move


makePromoteMove

private void makePromoteMove(Move move)
Makes a noncapture promotion


makeCaptureMove

public void makeCaptureMove(Move move)
Makes a capture move & checks if it is also a promotion. Overrides Piece.makeCaptureMove

Overrides:
makeCaptureMove in class Piece

undoCaptureMove

public void undoCaptureMove(Move move)
undos a normal pawn capture move /* * Overrides Piece.undoCaptureMove.

Overrides:
undoCaptureMove in class Piece