package com.editev.chess.printer; import com.editev.chess.GameHTML; /** Prints a single square on the chess board.. * * @see See the source here. */ public class SquarePrinter extends Printer { /** Prints a single piece. */ public Printer piecePrinter = new PiecePrinter(); /** Prints the entire board. * @param game the GameHTML with the board status and PrintStream for this board. */ public void print( GameHTML game ) { byte piece = game.getPieceIndex( game.square ); // what piece is on the square? game.out.printIndent( "" ); // end the target of the table entry piecePrinter.print( game ); // print just the piece's HTML. game.out.print( "\n" ); // finally, the end of the table entry. } }