* return the SGF (4) representation of the move
* SGF stands for Smart Game Format and is commonly used for Go
*/
@Override
protected String getSgfForMove(Move move) {
GoMove m = (GoMove) move;
// passes are not represented in SGF - so just skip it if the piece is null.
if (m.getPiece() == null)
return "[]";
StringBuilder buf = new StringBuilder("");
char player = 'W';
if ( m.getPiece().isOwnedByPlayer1() ) {
player = 'B';
}
buf.append( ';' );
buf.append( player );
buf.append( '[' );
buf.append( (char) ('a' + m.getToCol() - 1) );
buf.append( (char) ('a' + m.getToRow() - 1) );
buf.append( ']' );
buf.append( '\n' );
return buf.toString();
}