mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-04-02 18:30:44 +02:00
Removed redundant public access modifier for interface methods.
This commit is contained in:
parent
3eb0156cc5
commit
92cd27724a
@ -31,26 +31,26 @@ public interface Player {
|
|||||||
* This makes it possible for the player to correctly handle
|
* This makes it possible for the player to correctly handle
|
||||||
* the draw by repetition rule.
|
* the draw by repetition rule.
|
||||||
*/
|
*/
|
||||||
public String getCommand(Position pos, boolean drawOffer, List<Position> history);
|
String getCommand(Position pos, boolean drawOffer, List<Position> history);
|
||||||
|
|
||||||
/** Return true if this player is a human player. */
|
/** Return true if this player is a human player. */
|
||||||
public boolean isHumanPlayer();
|
boolean isHumanPlayer();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inform player whether or not to use an opening book.
|
* Inform player whether or not to use an opening book.
|
||||||
* Of course, a human player is likely to ignore this.
|
* Of course, a human player is likely to ignore this.
|
||||||
*/
|
*/
|
||||||
public void useBook(boolean bookOn);
|
void useBook(boolean bookOn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inform player about min recommended/max allowed thinking time per move.
|
* Inform player about min recommended/max allowed thinking time per move.
|
||||||
* Of course, a human player is likely to ignore this.
|
* Of course, a human player is likely to ignore this.
|
||||||
*/
|
*/
|
||||||
public void timeLimit(int minTimeLimit, int maxTimeLimit, boolean randomMode);
|
void timeLimit(int minTimeLimit, int maxTimeLimit, boolean randomMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inform player that the transposition table should be cleared.
|
* Inform player that the transposition table should be cleared.
|
||||||
* Of course, a human player has a hard time implementing this.
|
* Of course, a human player has a hard time implementing this.
|
||||||
*/
|
*/
|
||||||
public void clearTT();
|
void clearTT();
|
||||||
}
|
}
|
||||||
|
@ -119,11 +119,11 @@ public class Search {
|
|||||||
* Used to get various search information during search
|
* Used to get various search information during search
|
||||||
*/
|
*/
|
||||||
public interface Listener {
|
public interface Listener {
|
||||||
public void notifyDepth(int depth);
|
void notifyDepth(int depth);
|
||||||
public void notifyCurrMove(Move m, int moveNr);
|
void notifyCurrMove(Move m, int moveNr);
|
||||||
public void notifyPV(int depth, int score, int time, long nodes, int nps,
|
void notifyPV(int depth, int score, int time, long nodes, int nps,
|
||||||
boolean isMate, boolean upperBound, boolean lowerBound, ArrayList<Move> pv);
|
boolean isMate, boolean upperBound, boolean lowerBound, ArrayList<Move> pv);
|
||||||
public void notifyStats(long nodes, int nps, int time);
|
void notifyStats(long nodes, int nps, int time);
|
||||||
}
|
}
|
||||||
|
|
||||||
Listener listener;
|
Listener listener;
|
||||||
|
@ -24,35 +24,35 @@ import chess.Position;
|
|||||||
public interface GUIInterface {
|
public interface GUIInterface {
|
||||||
|
|
||||||
/** Update the displayed board position. */
|
/** Update the displayed board position. */
|
||||||
public void setPosition(Position pos);
|
void setPosition(Position pos);
|
||||||
|
|
||||||
/** Mark square i as selected. Set to -1 to clear selection. */
|
/** Mark square i as selected. Set to -1 to clear selection. */
|
||||||
public void setSelection(int sq);
|
void setSelection(int sq);
|
||||||
|
|
||||||
/** Set the status text. */
|
/** Set the status text. */
|
||||||
public void setStatusString(String str);
|
void setStatusString(String str);
|
||||||
|
|
||||||
/** Update the list of moves. */
|
/** Update the list of moves. */
|
||||||
public void setMoveListString(String str);
|
void setMoveListString(String str);
|
||||||
|
|
||||||
/** Update the computer thinking information. */
|
/** Update the computer thinking information. */
|
||||||
public void setThinkingString(String str);
|
void setThinkingString(String str);
|
||||||
|
|
||||||
/** Get the current time limit. */
|
/** Get the current time limit. */
|
||||||
public int timeLimit();
|
int timeLimit();
|
||||||
|
|
||||||
/** Get "random move" setting. */
|
/** Get "random move" setting. */
|
||||||
public boolean randomMode();
|
boolean randomMode();
|
||||||
|
|
||||||
/** Return true if "show thinking" is enabled. */
|
/** Return true if "show thinking" is enabled. */
|
||||||
public boolean showThinking();
|
boolean showThinking();
|
||||||
|
|
||||||
/** Ask what to promote a pawn to. Should call reportPromotePiece() when done. */
|
/** Ask what to promote a pawn to. Should call reportPromotePiece() when done. */
|
||||||
public void requestPromotePiece();
|
void requestPromotePiece();
|
||||||
|
|
||||||
/** Run code on the GUI thread. */
|
/** Run code on the GUI thread. */
|
||||||
public void runOnUIThread(Runnable runnable);
|
void runOnUIThread(Runnable runnable);
|
||||||
|
|
||||||
/** Report that user attempted to make an invalid move. */
|
/** Report that user attempted to make an invalid move. */
|
||||||
public void reportInvalidMove(Move m);
|
void reportInvalidMove(Move m);
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,5 @@ package org.petero.droidfish;
|
|||||||
public interface ActionFactory {
|
public interface ActionFactory {
|
||||||
|
|
||||||
/** Create action given an action ID. */
|
/** Create action given an action ID. */
|
||||||
public UIAction getAction(String actionId);
|
UIAction getAction(String actionId);
|
||||||
}
|
}
|
||||||
|
@ -28,10 +28,10 @@ import org.petero.droidfish.gamelogic.Position;
|
|||||||
public interface GUIInterface {
|
public interface GUIInterface {
|
||||||
|
|
||||||
/** Update the displayed board position. */
|
/** Update the displayed board position. */
|
||||||
public void setPosition(Position pos, String variantInfo, ArrayList<Move> variantMoves);
|
void setPosition(Position pos, String variantInfo, ArrayList<Move> variantMoves);
|
||||||
|
|
||||||
/** Mark square sq as selected. Set to -1 to clear selection. */
|
/** Mark square sq as selected. Set to -1 to clear selection. */
|
||||||
public void setSelection(int sq);
|
void setSelection(int sq);
|
||||||
|
|
||||||
final static class GameStatus {
|
final static class GameStatus {
|
||||||
public Game.GameState state = Game.GameState.ALIVE;
|
public Game.GameState state = Game.GameState.ALIVE;
|
||||||
@ -45,10 +45,10 @@ public interface GUIInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Set the status text. */
|
/** Set the status text. */
|
||||||
public void setStatus(GameStatus status);
|
void setStatus(GameStatus status);
|
||||||
|
|
||||||
/** Update the list of moves. */
|
/** Update the list of moves. */
|
||||||
public void moveListUpdated();
|
void moveListUpdated();
|
||||||
|
|
||||||
final public static class ThinkingInfo {
|
final public static class ThinkingInfo {
|
||||||
public int id;
|
public int id;
|
||||||
@ -62,50 +62,50 @@ public interface GUIInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Update the computer thinking information. */
|
/** Update the computer thinking information. */
|
||||||
public void setThinkingInfo(ThinkingInfo ti);
|
void setThinkingInfo(ThinkingInfo ti);
|
||||||
|
|
||||||
/** Ask what to promote a pawn to. Should call reportPromotePiece() when done. */
|
/** Ask what to promote a pawn to. Should call reportPromotePiece() when done. */
|
||||||
public void requestPromotePiece();
|
void requestPromotePiece();
|
||||||
|
|
||||||
/** Run code on the GUI thread. */
|
/** Run code on the GUI thread. */
|
||||||
public void runOnUIThread(Runnable runnable);
|
void runOnUIThread(Runnable runnable);
|
||||||
|
|
||||||
/** Report that user attempted to make an invalid move. */
|
/** Report that user attempted to make an invalid move. */
|
||||||
public void reportInvalidMove(Move m);
|
void reportInvalidMove(Move m);
|
||||||
|
|
||||||
/** Report UCI engine name. */
|
/** Report UCI engine name. */
|
||||||
public void reportEngineName(String engine);
|
void reportEngineName(String engine);
|
||||||
|
|
||||||
/** Report UCI engine error message. */
|
/** Report UCI engine error message. */
|
||||||
public void reportEngineError(String errMsg);
|
void reportEngineError(String errMsg);
|
||||||
|
|
||||||
/** Called when a move is played. GUI can notify user, for example by playing a sound. */
|
/** Called when a move is played. GUI can notify user, for example by playing a sound. */
|
||||||
public void movePlayed(Position pos, Move move, boolean computerMove);
|
void movePlayed(Position pos, Move move, boolean computerMove);
|
||||||
|
|
||||||
/** Report remaining thinking time to GUI. */
|
/** Report remaining thinking time to GUI. */
|
||||||
public void setRemainingTime(int wTime, int bTime, int nextUpdate);
|
void setRemainingTime(int wTime, int bTime, int nextUpdate);
|
||||||
|
|
||||||
/** Update engine title text. */
|
/** Update engine title text. */
|
||||||
public void updateEngineTitle();
|
void updateEngineTitle();
|
||||||
|
|
||||||
/** Update title with the material difference. */
|
/** Update title with the material difference. */
|
||||||
public void updateMaterialDifferenceTitle(Util.MaterialDiff diff);
|
void updateMaterialDifferenceTitle(Util.MaterialDiff diff);
|
||||||
|
|
||||||
/** Update title with time control information. */
|
/** Update title with time control information. */
|
||||||
public void updateTimeControlTitle();
|
void updateTimeControlTitle();
|
||||||
|
|
||||||
/** Report a move made that is a candidate for GUI animation. */
|
/** Report a move made that is a candidate for GUI animation. */
|
||||||
public void setAnimMove(Position sourcePos, Move move, boolean forward);
|
void setAnimMove(Position sourcePos, Move move, boolean forward);
|
||||||
|
|
||||||
/** Return true if positive analysis scores means good for white. */
|
/** Return true if positive analysis scores means good for white. */
|
||||||
public boolean whiteBasedScores();
|
boolean whiteBasedScores();
|
||||||
|
|
||||||
/** Return true if pondering (permanent brain) is enabled. */
|
/** Return true if pondering (permanent brain) is enabled. */
|
||||||
public boolean ponderMode();
|
boolean ponderMode();
|
||||||
|
|
||||||
/** Get the default player name. */
|
/** Get the default player name. */
|
||||||
public String playerName();
|
String playerName();
|
||||||
|
|
||||||
/** Return true if only main-line moves are to be kept. */
|
/** Return true if only main-line moves are to be kept. */
|
||||||
public boolean discardVariations();
|
boolean discardVariations();
|
||||||
}
|
}
|
||||||
|
@ -21,14 +21,14 @@ package org.petero.droidfish;
|
|||||||
/** Interface for user interface actions. */
|
/** Interface for user interface actions. */
|
||||||
public interface UIAction extends Runnable {
|
public interface UIAction extends Runnable {
|
||||||
/** Get a unique identifier for this action. */
|
/** Get a unique identifier for this action. */
|
||||||
public String getId();
|
String getId();
|
||||||
|
|
||||||
/** Get name resource for the action. */
|
/** Get name resource for the action. */
|
||||||
public int getName();
|
int getName();
|
||||||
|
|
||||||
/** Get icon SVG resource or -1 for no icon. */
|
/** Get icon SVG resource or -1 for no icon. */
|
||||||
public int getIcon();
|
int getIcon();
|
||||||
|
|
||||||
/** Return true if the action is currently enabled. */
|
/** Return true if the action is currently enabled. */
|
||||||
public boolean enabled();
|
boolean enabled();
|
||||||
}
|
}
|
||||||
|
@ -31,29 +31,29 @@ public interface UCIEngine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Start engine. */
|
/** Start engine. */
|
||||||
public void initialize();
|
void initialize();
|
||||||
|
|
||||||
/** Initialize default options. */
|
/** Initialize default options. */
|
||||||
public void initOptions(EngineOptions engineOptions);
|
void initOptions(EngineOptions engineOptions);
|
||||||
|
|
||||||
/** Read UCI options from .ini file and send them to the engine. */
|
/** Read UCI options from .ini file and send them to the engine. */
|
||||||
public void applyIniFile();
|
void applyIniFile();
|
||||||
|
|
||||||
/** Set engine UCI options. */
|
/** Set engine UCI options. */
|
||||||
public boolean setUCIOptions(Map<String,String> uciOptions);
|
boolean setUCIOptions(Map<String,String> uciOptions);
|
||||||
|
|
||||||
/** Save non-default UCI option values to file. */
|
/** Save non-default UCI option values to file. */
|
||||||
public void saveIniFile(UCIOptions options);
|
void saveIniFile(UCIOptions options);
|
||||||
|
|
||||||
/** Get engine UCI options. */
|
/** Get engine UCI options. */
|
||||||
public UCIOptions getUCIOptions();
|
UCIOptions getUCIOptions();
|
||||||
|
|
||||||
/** Return true if engine options have correct values.
|
/** Return true if engine options have correct values.
|
||||||
* If false is returned, engine will be restarted. */
|
* If false is returned, engine will be restarted. */
|
||||||
public boolean optionsOk(EngineOptions engineOptions);
|
boolean optionsOk(EngineOptions engineOptions);
|
||||||
|
|
||||||
/** Shut down engine. */
|
/** Shut down engine. */
|
||||||
public void shutDown();
|
void shutDown();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read a line from the engine.
|
* Read a line from the engine.
|
||||||
@ -62,30 +62,30 @@ public interface UCIEngine {
|
|||||||
* or empty string if no data available,
|
* or empty string if no data available,
|
||||||
* or null if I/O error.
|
* or null if I/O error.
|
||||||
*/
|
*/
|
||||||
public String readLineFromEngine(int timeoutMillis);
|
String readLineFromEngine(int timeoutMillis);
|
||||||
|
|
||||||
// FIXME!! Writes should be handled by separate thread.
|
// FIXME!! Writes should be handled by separate thread.
|
||||||
/** Write a line to the engine. \n will be added automatically. */
|
/** Write a line to the engine. \n will be added automatically. */
|
||||||
public void writeLineToEngine(String data);
|
void writeLineToEngine(String data);
|
||||||
|
|
||||||
/** Set the engine strength, allowed values 0 - 1000. */
|
/** Set the engine strength, allowed values 0 - 1000. */
|
||||||
public void setStrength(int strength);
|
void setStrength(int strength);
|
||||||
|
|
||||||
/** Set an engine integer option. */
|
/** Set an engine integer option. */
|
||||||
public void setOption(String name, int value);
|
void setOption(String name, int value);
|
||||||
|
|
||||||
/** Set an engine boolean option. */
|
/** Set an engine boolean option. */
|
||||||
public void setOption(String name, boolean value);
|
void setOption(String name, boolean value);
|
||||||
|
|
||||||
/** Set an engine option. If the option is not a string option,
|
/** Set an engine option. If the option is not a string option,
|
||||||
* value is converted to the correct type.
|
* value is converted to the correct type.
|
||||||
* @return True if the option was changed. */
|
* @return True if the option was changed. */
|
||||||
public boolean setOption(String name, String value);
|
boolean setOption(String name, String value);
|
||||||
|
|
||||||
/** Clear list of supported options. */
|
/** Clear list of supported options. */
|
||||||
public void clearOptions();
|
void clearOptions();
|
||||||
|
|
||||||
/** Register an option as supported by the engine.
|
/** Register an option as supported by the engine.
|
||||||
* @param tokens The UCI option line sent by the engine, split in words. */
|
* @param tokens The UCI option line sent by the engine, split in words. */
|
||||||
public UCIOptions.OptionBase registerOption(String[] tokens);
|
UCIOptions.OptionBase registerOption(String[] tokens);
|
||||||
}
|
}
|
||||||
|
@ -49,15 +49,15 @@ public class PgnToken {
|
|||||||
/** PGN parser visitor interface. */
|
/** PGN parser visitor interface. */
|
||||||
public interface PgnTokenReceiver {
|
public interface PgnTokenReceiver {
|
||||||
/** If this method returns false, the object needs a full re-initialization, using clear() and processToken(). */
|
/** If this method returns false, the object needs a full re-initialization, using clear() and processToken(). */
|
||||||
public boolean isUpToDate();
|
boolean isUpToDate();
|
||||||
|
|
||||||
/** Clear object state. */
|
/** Clear object state. */
|
||||||
public void clear();
|
void clear();
|
||||||
|
|
||||||
/** Update object state with one token from a PGN game. */
|
/** Update object state with one token from a PGN game. */
|
||||||
public void processToken(GameTree.Node node, int type, String token);
|
void processToken(GameTree.Node node, int type, String token);
|
||||||
|
|
||||||
/** Change current move number. */
|
/** Change current move number. */
|
||||||
public void setCurrent(GameTree.Node node);
|
void setCurrent(GameTree.Node node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,30 +56,30 @@ public interface SearchListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Report current engine search depth. */
|
/** Report current engine search depth. */
|
||||||
public void notifyDepth(int id, int depth);
|
void notifyDepth(int id, int depth);
|
||||||
|
|
||||||
/** Report the move, valid in position pos, that the engine is currently searching. */
|
/** Report the move, valid in position pos, that the engine is currently searching. */
|
||||||
public void notifyCurrMove(int id, Position pos, Move m, int moveNr);
|
void notifyCurrMove(int id, Position pos, Move m, int moveNr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report PV information. If ponderMove is non-null, ponderMove is the first move
|
* Report PV information. If ponderMove is non-null, ponderMove is the first move
|
||||||
* to play from position pos.
|
* to play from position pos.
|
||||||
*/
|
*/
|
||||||
public void notifyPV(int id, Position pos, ArrayList<PvInfo> pvInfo, Move ponderMove);
|
void notifyPV(int id, Position pos, ArrayList<PvInfo> pvInfo, Move ponderMove);
|
||||||
|
|
||||||
/** Report search statistics. */
|
/** Report search statistics. */
|
||||||
public void notifyStats(int id, long nodes, int nps, long tbHits, int hash, int time);
|
void notifyStats(int id, long nodes, int nps, long tbHits, int hash, int time);
|
||||||
|
|
||||||
/** Report opening book information. */
|
/** Report opening book information. */
|
||||||
public void notifyBookInfo(int id, String bookInfo, ArrayList<Move> moveList,
|
void notifyBookInfo(int id, String bookInfo, ArrayList<Move> moveList,
|
||||||
String eco, int distToEcoTree);
|
String eco, int distToEcoTree);
|
||||||
|
|
||||||
/** Report move (or command, such as "resign") played by the engine. */
|
/** Report move (or command, such as "resign") played by the engine. */
|
||||||
public void notifySearchResult(int id, String cmd, Move ponder);
|
void notifySearchResult(int id, String cmd, Move ponder);
|
||||||
|
|
||||||
/** Report engine name. */
|
/** Report engine name. */
|
||||||
public void notifyEngineName(String engineName);
|
void notifyEngineName(String engineName);
|
||||||
|
|
||||||
/** Report engine error. */
|
/** Report engine error. */
|
||||||
public void reportEngineError(String errMsg);
|
void reportEngineError(String errMsg);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user