|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.java_chess.javaChess.engine.ChessEngineImpl
This class implements the functionality to play the actual game of chess
Constructor Summary | |
ChessEngineImpl(Game game,
Board board,
boolean white)
Create a new engine instance with a given board. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent actionEvent)
Perform a action (could be a menu related action). |
short |
analyzeBoard(Board board)
Compute a score for a game position. |
Ply |
computeBestPly()
Compute the best ply for the current position. |
Board |
getBoard()
Get the current board. |
Game |
getGame()
Get the current game. |
int |
getMaximumSearchTime()
Get the maximum search time. |
javax.swing.JMenu |
getMenu()
Return a menu from the chess engine, where the user can change the settings. |
boolean |
isWhite()
Get the color of this engine. |
void |
run()
The main method of the search thread. |
void |
setBoard(Board board)
Set the board. |
void |
setEnginePanel(EnginePanel panel)
Sets the EnginePanel to be able to output in the panel and not only with System.out.println(...) |
void |
setGame(Game game)
Set the current game. |
void |
setMaximumSearchTime(int time)
Set the maximum search time. |
void |
setWhite(boolean white)
Set the color of the engine. |
void |
start()
Start a new thread to search for a ply. |
boolean |
validateUserPly(Ply ply)
Check if a ply made by the user is valid. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ChessEngineImpl(Game game, Board board, boolean white)
board
- The new board.white
- Flag, to indicate if the engine operates on the white pieces.Method Detail |
public final Game getGame()
public final void setGame(Game game)
The
- current game.public Board getBoard()
public void setBoard(Board board)
board
- The new board.public final int getMaximumSearchTime()
public final void setMaximumSearchTime(int time)
depth
- The new search time.public boolean isWhite()
white
- true, if the engine operates with the white pieces.public void setWhite(boolean white)
white
- flag to indicate if the engine operates on the white pieces.public void start()
public Ply computeBestPly()
public void run()
public final short analyzeBoard(Board board)
public final boolean validateUserPly(Ply ply)
ply
- The user ply.public final javax.swing.JMenu getMenu()
public final void actionPerformed(java.awt.event.ActionEvent actionEvent)
actionEvent
- The event.public void setEnginePanel(EnginePanel panel)
panel
- The EnginePanel to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |