package com.editev.chess.printer; import com.editev.chess.GameHTML; import com.editev.chess.Move; /** Prints the move history for a Game. * * @see See the source here. */ public class HistoryPrinter extends Printer { public void printOneMove( GameHTML game, int moveIndex, StringBuffer moveString ) { Move move = game.moveHistory.getAt( moveIndex ); game.out.print( "
| "); int m = 1+moveIndex/2; if (game.textOnly) { if (m < 100) game.out.print( " " ); if (m < 10 ) game.out.print( " " ); } game.out.print( m+"." ); game.out.print( " | "); printOneMove( game, moveIndex, str ); if ((moveIndex+1) < moves) { printOneMove( game, moveIndex+1, str ); game.out.print( "\n" ); if ( (1+moveIndex/2) % MOVES_PER_TABLE == 0 && moveIndex+2 < moves ) { // out of space, start a new table! game.out.endTag( "