2019-07-19 22:16:02 +02:00
|
|
|
package dev.kske.chess.uci;
|
|
|
|
|
2019-07-31 17:47:49 +02:00
|
|
|
import dev.kske.chess.board.Move;
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Project: <strong>Chess</strong><br>
|
|
|
|
* File: <strong>UCIListener.java</strong><br>
|
|
|
|
* Created: <strong>19.07.2019</strong><br>
|
2020-05-19 16:50:12 +02:00
|
|
|
*
|
2019-10-26 07:55:21 +02:00
|
|
|
* @since Chess v0.3-alpha
|
|
|
|
* @author Kai S. K. Engelbart
|
2019-07-19 22:16:02 +02:00
|
|
|
*/
|
|
|
|
public interface UCIListener {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Identifies the name of the engine.
|
2020-05-19 16:50:12 +02:00
|
|
|
*
|
2019-07-19 22:16:02 +02:00
|
|
|
* @param name The name of the engine
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onIdName(String name) {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Identifies the author of the engine.
|
2020-05-19 16:50:12 +02:00
|
|
|
*
|
2019-07-19 22:16:02 +02:00
|
|
|
* @param author The name of the engine's author
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onIdAuthor(String author) {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The engine is ready in UCI mode.
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onUCIOk() {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The engine has processed all inputs and is ready for new commands.
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onReadyOk() {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The engine has stopped searching and has found the best move.
|
2020-05-19 16:50:12 +02:00
|
|
|
*
|
2019-07-19 22:16:02 +02:00
|
|
|
* @param move The best moves the engine has found
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onBestMove(String move) {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The engine has stopped searching and has found the best move.
|
2020-05-19 16:50:12 +02:00
|
|
|
*
|
2019-07-19 22:16:02 +02:00
|
|
|
* @param move The best move the engine has found
|
|
|
|
* @param ponderMove The move the engine likes to ponder on
|
|
|
|
*/
|
2019-07-31 17:47:49 +02:00
|
|
|
default void onBestMove(String move, Move ponderMove) {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The engine will check the copy protection now.
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onCopyProtectionChecking() {}
|
2019-10-26 07:55:21 +02:00
|
|
|
|
2019-07-19 22:16:02 +02:00
|
|
|
/**
|
|
|
|
* The engine has successfully checked the copy protection.
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onCopyProtectionOk() {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The engine has encountered an error during copy protection checking.
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onCopyProtectionError() {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The engine will check the registration now.
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onRegistrationChecking() {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The engine has successfully checked the registration.
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onRegistrationOk() {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The engine has encountered an error during registration checking.
|
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onRegistrationError() {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The engine sends information to the GUI.
|
2020-05-19 16:50:12 +02:00
|
|
|
*
|
2019-08-23 21:10:19 +02:00
|
|
|
* @param info Contains all pieces of information to be sent
|
2019-07-19 22:16:02 +02:00
|
|
|
*/
|
2019-07-31 17:47:49 +02:00
|
|
|
default void onInfo(UCIInfo info) {}
|
2019-07-19 22:16:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tells the GUI which parameters can be changed in the engine.
|
2020-05-19 16:50:12 +02:00
|
|
|
*
|
2019-07-22 08:59:13 +02:00
|
|
|
* @param option Option object describing the parameter
|
2019-07-19 22:16:02 +02:00
|
|
|
*/
|
2019-07-23 11:54:43 +02:00
|
|
|
default void onOption(UCIOption option) {}
|
2019-07-19 22:16:02 +02:00
|
|
|
}
|