Breakout Problem Set Javadocs

breakout
Class BoardLoader

java.lang.Object
  extended bybreakout.BoardLoader

public class BoardLoader
extends java.lang.Object

loads a board from a file, adding bricks to the world it was constructed with. The format of a board file is as follows:

character fully-qualified-class-name [Color-in-hex [hp]] Only 1 space is allowed between each part. An example:

b breakout.SimpleBrick 0x00FF00 2
It declares b to mean a green SimpleBrick which takes 2 hits.

A blank line signals the end of the declaration section. What follows is a block of characters, 20 to a line, 10 lines. A space denotes no brick, a character a brick according to the declaration section.

Version:
$Id: BoardLoader.java,v 1.2 2004/03/26 20:39:33 gus Exp $
Author:
benmv@olin.edu
See Also:
World, breakout.BenSimpleBrick

Constructor Summary
BoardLoader(World w)
          build with given World object target.
 
Method Summary
 void load(java.io.BufferedReader br)
          Load board from given BufferedReader.
 void load(java.io.File choice)
          Load board from given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoardLoader

public BoardLoader(World w)
build with given World object target.

Parameters:
w - World to add bricks to
Method Detail

load

public void load(java.io.File choice)
          throws BadBoardFormatException
Load board from given file.

Parameters:
choice - File to load board from.
Throws:
BadBoardFormatException - if the board file is malformatted.

load

public void load(java.io.BufferedReader br)
          throws BadBoardFormatException
Load board from given BufferedReader. Can be used to read boards from the network or wherever else.

Parameters:
br - BufferedReader to read board from.
Throws:
BadBoardFormatException - if the board is malformatted.

Breakout Problem Set Javadocs