| java.lang.Object org.millstone.examples.gogame.Game
All known Subclasses: org.millstone.examples.gogame.Board,
Inner Class :public interface Listener | |
Field Summary | |
final public static int | BLACK Black stone. | final public static int | EMPTY Empty position. | final public static int | WHITE |
Constructor Summary | |
public | Game(int boardSize, String blackPlayer, String whitePlayer) Creates a new game with the specified board size and player names. |
BLACK | final public static int BLACK(Code) | | Black stone.
|
EMPTY | final public static int EMPTY(Code) | | Empty position.
|
WHITE | final public static int WHITE(Code) | | White stone
|
Game | public Game(int boardSize, String blackPlayer, String whitePlayer)(Code) | | Creates a new game with the specified board size and player names.
|
addGameListener | public void addGameListener(Game.Listener listener)(Code) | | Adds a listener to the list of listeners
|
addStone | public void addStone(int i, int j, boolean isBlack)(Code) | | Adds a black or white stone to the specified position on the
board.
|
getBlackPlayer | public String getBlackPlayer()(Code) | | Gets the black player's name.
|
getCapturedBlackStones | public int getCapturedBlackStones()(Code) | | Get the number of black stones captures
|
getCapturedWhiteStones | public int getCapturedWhiteStones()(Code) | | Get the number of white stones captures
|
getMoves | public int getMoves()(Code) | | Gets the number of moves so far.
|
getState | public int[][] getState()(Code) | | Gets the current state of the game as a two-dimentional array
representing the board, with the states Game.EMPTY, Game.BLACK
and Game.WHITE.
|
getWhitePlayer | public String getWhitePlayer()(Code) | | Gets the white player's name.
|
removeGameListener | public void removeGameListener(Game.Listener listener)(Code) | | Removes a listener from the list of listeners.
|
toString | public String toString()(Code) | | This function returns the state of the game as a string.
|
|
|