|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.xistrat.math.ChessEngine
public class ChessEngine
Engine provides an autoplayer engine for the XiStrat Chess variant
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static int |
MOVE
|
static int |
NOTHING
|
static long |
sleepT
|
int |
strength
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ChessEngine(F4ClientCore clientCore,
boolean verbose,
java.lang.String game,
java.lang.String alias,
int strength)
|
Method Summary | |
---|---|
void |
abort()
|
void |
buildPlayField(java.lang.String positionID)
later on make Engine and XiStratPanel extend s.th. and put that source code into 1 single place (or whatever design pattern (composition vs inheritance) might be used instead to avoid ugly copy/paste) clientCore calls this after loginAck by server does as well hashTables declaration and initialization |
void |
doMove(int from,
int to)
sync representation |
void |
doPass()
|
void |
doPut(int to,
int cont)
dummy |
void |
doRemove(int loc,
int cont)
dummy |
void |
doUndo(int num)
|
int |
evaluate(FigurData[] fastFigs,
int atTurnOf)
inside loop, we use an incremental procedure instead |
void |
handleNewGame(boolean ok,
java.lang.String info)
methods called by F4ClientCore, implemeting ClientUI |
void |
logout()
|
void |
lose(java.lang.String winner)
|
int[] |
multiEvaluate(FigurData[] fastFigs,
int size)
|
void |
run()
for the moment we only do s.th. when it's our turn (no pondering, that is: no thinking on time of others so far) |
void |
setGameList(java.lang.String[] list,
java.lang.String[] position)
interface ClientUI |
void |
showErr(java.lang.String error)
|
void |
showMsg(java.lang.String info)
|
void |
waitForUserMove(boolean waitForMe)
|
void |
waitForUserRemove(boolean wait)
|
void |
waitForUserUndo(boolean undoForMe)
after victory, engine is nice and makes undo of the last 2 elementar moves (plies) |
void |
win()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final int strength
public static final int MOVE
public static final int NOTHING
public static final long sleepT
Constructor Detail |
---|
public ChessEngine(F4ClientCore clientCore, boolean verbose, java.lang.String game, java.lang.String alias, int strength)
strength
- number of levels the search should doMethod Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void setGameList(java.lang.String[] list, java.lang.String[] position)
setGameList
in interface ClientUI
public void handleNewGame(boolean ok, java.lang.String info)
handleNewGame
in interface ClientUI
public void showMsg(java.lang.String info)
showMsg
in interface ClientUI
public void showErr(java.lang.String error)
showErr
in interface ClientUI
public void abort()
abort
in interface ClientUI
public void logout()
logout
in interface ClientUI
public void lose(java.lang.String winner)
lose
in interface ClientUI
public void win()
win
in interface ClientUI
public void waitForUserMove(boolean waitForMe)
waitForUserMove
in interface ClientUI
public void waitForUserUndo(boolean undoForMe)
waitForUserUndo
in interface ClientUI
public void buildPlayField(java.lang.String positionID)
clientCore calls this after loginAck by server
does as well hashTables declaration and initialization
buildPlayField
in interface ClientUI
public void doPut(int to, int cont)
doPut
in interface ClientUI
public void doRemove(int loc, int cont)
doRemove
in interface ClientUI
public void doPass()
doPass
in interface ClientUI
public void waitForUserRemove(boolean wait)
waitForUserRemove
in interface ClientUI
public void doMove(int from, int to)
doMove
in interface ClientUI
public void doUndo(int num)
doUndo
in interface ClientUI
public int evaluate(FigurData[] fastFigs, int atTurnOf)
public int[] multiEvaluate(FigurData[] fastFigs, int size)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |