* Initialize the board based on the SGF game.
*/
@Override
protected void parseSGFGameInfo( SGFGame game) {
TwoPlayerController gc = (TwoPlayerController) controller_;
Enumeration e = game.getInfoTokens();
int numRows = 15; // default unless specified
int numCols = 12; // default unless specified
while (e.hasMoreElements()) {
InfoToken token = (InfoToken) e.nextElement();
if (token instanceof Size2Token) {
Size2Token sizeToken = (Size2Token)token;
GameContext.log(2, "info token columns =" + sizeToken.getNumColumns() +" rows=" + sizeToken.getNumRows());
numRows = sizeToken.getNumRows();
numCols = sizeToken.getNumColumns();
}
else if (token instanceof Player2NameToken) {
Player2NameToken nameToken = (Player2NameToken) token;
gc.getPlayers().getPlayer2().setName(nameToken.getName());
}
else if (token instanceof Player1NameToken) {
Player1NameToken nameToken = (Player1NameToken) token;
gc.getPlayers().getPlayer1().setName(nameToken.getName());
}
}
((IRectangularBoard)gc.getBoard()).setSize(numRows, numCols);
}