public final class GtpUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getTimeSettingsCommand(TimeSettings settings)
Get GTP time settings command .
|
static boolean |
isCommand(java.lang.String line)
Check if command line contains a command.
|
static boolean |
isStateChangingCommand(java.lang.String line)
Check if command changes the board state.
|
static double[][] |
parseDoubleBoard(java.lang.String response,
int boardSize) |
static GoPoint |
parsePoint(java.lang.String s,
int boardSize) |
static PointList |
parsePointList(java.lang.String s,
int boardSize) |
static PointList |
parsePointString(java.lang.String text)
Find all points contained in string.
|
static PointList |
parsePointString(java.lang.String text,
int boardSize)
Find all points contained in string.
|
static void |
parsePointStringList(java.lang.String s,
PointList pointList,
java.util.ArrayList<java.lang.String> stringList,
int boardsize) |
static java.lang.String[][] |
parseStringBoard(java.lang.String s,
int boardSize) |
static Move[] |
parseVariation(java.lang.String s,
GoColor toMove,
int boardSize)
Find all moves contained in string.
|
static void |
sendTimeLeft(GtpClientBase gtp,
ConstClock clock,
GoColor c)
Inform a GTP engine about the clock state.
|
public static java.lang.String getTimeSettingsCommand(TimeSettings settings)
settings
- The time settings. If null, this function will return
a GTP command for "no time limit" ("time_settings 0 1 0" with zero
byoyomi stones), which could confuse some programs, so it should be
only sent if necessary (when changing from a state with time settings
to a state with no time settings).public static boolean isCommand(java.lang.String line)
public static boolean isStateChangingCommand(java.lang.String line)
quit
command, and some known GTP extension
commands (e.g. gg-undo
from GNU Go and
gogui-play_sequence
from GoGui). Does not include
non-criticlal state changing commands like komi
.line
- The command or complete command linetrue
if command is a state-changing commandpublic static double[][] parseDoubleBoard(java.lang.String response, int boardSize) throws GtpResponseFormatError
GtpResponseFormatError
public static GoPoint parsePoint(java.lang.String s, int boardSize) throws GtpResponseFormatError
GtpResponseFormatError
public static PointList parsePointList(java.lang.String s, int boardSize) throws GtpResponseFormatError
GtpResponseFormatError
public static PointList parsePointString(java.lang.String text)
public static PointList parsePointString(java.lang.String text, int boardSize)
public static void parsePointStringList(java.lang.String s, PointList pointList, java.util.ArrayList<java.lang.String> stringList, int boardsize) throws GtpResponseFormatError
GtpResponseFormatError
public static java.lang.String[][] parseStringBoard(java.lang.String s, int boardSize) throws GtpResponseFormatError
GtpResponseFormatError
public static Move[] parseVariation(java.lang.String s, GoColor toMove, int boardSize)
public static void sendTimeLeft(GtpClientBase gtp, ConstClock clock, GoColor c)