com.editev.chess
Class Chess

java.lang.Object
  |
  +--com.editev.chess.Chess
Direct Known Subclasses:
Board, Piece, Printer

public abstract class Chess
extends java.lang.Object

Constants defining the game of chess.

!
See Also:
the source here.

Inner Class Summary
static class Chess.Black
          A set of constants representing Black's pieces.
static class Chess.White
          A set of constants representing White's pieces.
 
Field Summary
static byte BLACK
          Black's home rank, also used as an identifier for Black
static byte NO_MOVE
          Represents no move from a list.
static byte NO_PIECE
          Represents no piece on a square.
static byte WHITE
          White's home rank, also used as an identifier for White
 
Constructor Summary
Chess()
           
 
Method Summary
static byte notColor(byte color)
          Exchange WHITE and BLACK.
static byte toColor(boolean isWhite)
          Return either WHITE or BLACK.
static byte toColor(boolean isWhite, byte piece)
          Return either WHITE or BLACK.
static java.lang.String toColorName(boolean isWhite)
          Return either "White" or "Black".
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

NO_PIECE

public static final byte NO_PIECE
Represents no piece on a square.

NO_MOVE

public static final byte NO_MOVE
Represents no move from a list.

BLACK

public static final byte BLACK
Black's home rank, also used as an identifier for Black

WHITE

public static final byte WHITE
White's home rank, also used as an identifier for White
Constructor Detail

Chess

public Chess()
Method Detail

notColor

public static final byte notColor(byte color)
Exchange WHITE and BLACK. @parameter color a color, either BLACK or WHITE. @return the other color, White or Black.

toColor

public static final byte toColor(boolean isWhite)
Return either WHITE or BLACK. @parameter isWhite do we want BLACK or WHITE? @return WHITE or BLACK depending on isWhite.

toColor

public static final byte toColor(boolean isWhite,
                                 byte piece)
Return either WHITE or BLACK. @parameter isWhite do we want BLACK or WHITE? @return WHITE or BLACK depending on isWhite.

toColorName

public static final java.lang.String toColorName(boolean isWhite)
Return either "White" or "Black". @parameter isWhite do we want "Black" or "White"? @return "White" or "Black" depending on isWhite.