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