klaus.engine
Class WinBoardXBoardEngine
java.lang.Object
klaus.engine.Engine
klaus.engine.WinBoardXBoardEngine
- All Implemented Interfaces:
- Runnable
public class WinBoardXBoardEngine
- extends Engine
- implements Runnable
Connects to a WinBoard/XBoard engine.
- Since:
- 2009-03-15 alpha2
- Author:
- Stephan Hillebrand
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
connection
private Process connection
input
private BufferedReader input
output
private PrintWriter output
engineThread
private Thread engineThread
cancel
private boolean cancel
running
private boolean running
inForceMode
private boolean inForceMode
lines
private static final char[] lines
rows
private static final char[] rows
WinBoardXBoardEngine
public WinBoardXBoardEngine(String commandLine)
throws IOException
- Throws:
IOException
handle
private void handle(String message)
run
public void run()
- Specified by:
run
in interface Runnable
resyncPosition
private void resyncPosition()
setForceMode
private void setForceMode(boolean mode)
sendmsg
private void sendmsg(String message)
startCalculation
public void startCalculation()
- Specified by:
startCalculation
in class Engine
cancel
public void cancel()
- Specified by:
cancel
in class Engine
unload
public void unload()
- Specified by:
unload
in class Engine
forceMove
public void forceMove()
- Specified by:
forceMove
in class Engine
setTimeModel
public void setTimeModel(int timeInMinutes,
int movesToNextPeriod,
int increment)
- Description copied from class:
Engine
Set the time model, equivalent to XBoards "level" command.
This method should be called in two situations:
- A new game was started: Set the time model, timeInMinutes is the
time each player has for the first period.
- A new period just started: set the new time AFTER the time was added to each player's clock. In this case,
timeInMinutes is the old value + the time added
- Specified by:
setTimeModel
in class Engine
- Parameters:
timeInMinutes
- the time for this periodmovesToNextPeriod
- the number of moves to the next periodincrement
- the increment per move (Fischer clock) (in seconds)