public final class BoardUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
NUMBER_ROTATIONS
Number of rotation modes for
BoardUtil.rotate() . |
Modifier and Type | Method and Description |
---|---|
static void |
copy(Board target,
ConstBoard source)
Copy the state of one board to another.
|
static GoPoint |
rotate(int rotationMode,
GoPoint point,
int size)
Rotate/mirror point.
|
static java.lang.String |
toString(ConstBoard board)
Get board position as text diagram (without additional game
information).
|
static java.lang.String |
toString(ConstBoard board,
boolean withGameInfo,
boolean color)
Get board position as text diagram.
|
public static final int NUMBER_ROTATIONS
BoardUtil.rotate()
.public static void copy(Board target, ConstBoard source)
public static java.lang.String toString(ConstBoard board)
toString()
with withGameInfo == false
.#toString(ConstBoard, boolean)
public static java.lang.String toString(ConstBoard board, boolean withGameInfo, boolean color)
board
- The board to print.withGameInfo
- Print additional game information on the right
side of the board (at present only number of prisoners)color
- Colorize board using ANSI escape sequencespublic static GoPoint rotate(int rotationMode, GoPoint point, int size)
Mode | x | y |
---|---|---|
0 | x | y |
1 | size - x - 1 | y |
2 | x | size - y - 1 |
3 | y | x |
4 | size - y - 1 | x |
5 | y | size - x - 1 |
6 | size - x - 1 | size - y - 1 |
7 | size - y - 1 | size - x - 1 |
rotationMode
- The rotation mode in [0..NUMBER_ROTATIONS]point
- The point to be rotatedsize
- The board size