|
Internet Chess ToolKit v0.2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectictk.boardgame.chess.Square
this is a typical location on a chess board. It contains an occupant, file, and a rank.
Field Summary | |
ChessPiece |
piece
the piece standing on the square |
Constructor Summary | |
Square()
|
|
Square(byte f,
byte r)
|
|
Square(char f,
char r)
|
Method Summary | |
java.lang.String |
dump()
|
boolean |
equals(java.lang.Object obj)
checks to see of the file and rank are the same. |
int[] |
getCoordinatesNumeric()
this returns an int array of the numberic representation of the file and the rank. |
byte |
getFile()
|
char |
getFileAsChar()
translates the file into its traditional english letter value ('a'-'h') |
ChessPiece |
getOccupant()
same as getPiece() but returns the piece in the ChessPiece class |
Piece |
getPiece()
gets the current occupant of the square. |
byte |
getRank()
|
char |
getRankAsChar()
translates the rank into its traditional Arabic number value ('1'-'8') |
int |
getX()
this is the internal horizontal coordinate for the position. |
int |
getY()
this is the internal vertical coordinate for the position. |
int |
hashCode()
|
boolean |
isBlack()
what color is this square on a traditional chess board? |
boolean |
isOccupied()
is there a piece standing on this square. |
void |
set(byte f,
byte r)
|
void |
set(char f,
char r)
|
boolean |
setOccupant(ChessPiece p)
this is the same as setPiece, but specific for the Chess package. |
Piece |
setPiece(Piece p)
sets the occupant of the square |
void |
setX(int x)
|
void |
setY(int y)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public ChessPiece piece
Constructor Detail |
public Square()
public Square(byte f, byte r)
public Square(char f, char r)
Method Detail |
public int getX()
Location
getX
in interface Location
public int getY()
Location
getY
in interface Location
public void setX(int x)
setX
in interface Location
public void setY(int y)
setY
in interface Location
public Piece getPiece()
getPiece
in interface Location
public Piece setPiece(Piece p)
setPiece
in interface Location
public boolean isBlack()
public byte getFile()
public byte getRank()
public char getFileAsChar()
public char getRankAsChar()
public boolean isOccupied()
public boolean setOccupant(ChessPiece p)
public ChessPiece getOccupant()
public void set(byte f, byte r)
public void set(char f, char r)
public int[] getCoordinatesNumeric()
public boolean equals(java.lang.Object obj)
public int hashCode()
public java.lang.String toString()
public java.lang.String dump()
|
Submit a bug or feature Visit the Website Internet Chess ToolKit is licensed under the GPL v2 . |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |