package com.editev.chess.printer;

import com.editev.chess.GameHTML;


/** Prints just the promotion area.
 *
 *  @see See the source here.
 */
public class PromotionPrinter extends Printer {
    /** Prints just the promotion area.
     *  @param game the GameHTML with the board status and PrintStream for this board.
     */
    public void print( GameHTML game ) {
        // target printing the form and the selection information. 
        game.out.println();
        
        game.out.startTag( "\n" );

        for ( byte b=0, p = Black.QUEEN; p <= Black.KNIGHT; b++, p++) {      // for each possible promotion.
            if (0 == b%2) {
                game.out.startTag( "\n" );
                game.out.printIndent();
            }
            game.out.print( "" );
          
            if (1 == b%2) {
                game.out.endTag( "\n" );
            }
        }
                
        game.out.endTag(   "
" ); if (game.hasJavascript) { game.out.print( "" ); // finish the tag } else { game.out.print( "" ); // finish the tag } game.out.print( game.getPieceHTML( p ) ); // description of the piece. game.out.print( "" ); game.out.print( "
\n" ); game.out.printIndent(); } }