001 package rules;
002 import core.Color;
003 import core.Piece;
004
005 /**
006 * Rook piece.
007 */
008 public class Rook extends StraightPiece {
009 /**
010 * @see Piece
011 */
012 protected String getName(){ return "R";}
013
014 /**
015 * @see Piece
016 */
017 public Rook(Color color, int lastMove){
018 super(color, lastMove, true, false);
019 }
020 /**
021 * @see Piece
022 */
023 protected StraightPiece constructor(Color color, int lastMove){
024 return new Rook(color, lastMove);
025 }
026 /**
027 * @see Piece
028 */
029 public String pieceString()
030 {
031 return "rook";
032 }
033 public int hashCode() {
034 return 2*2 + (color == Color.WHITE ? 0 : 1);
035 }
036 }