|
Breakout Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbreakout.BoardLoader
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 2It declares b to mean a green SimpleBrick which takes 2 hits.
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 |
public BoardLoader(World w)
w
- World to add bricks toMethod Detail |
public void load(java.io.File choice) throws BadBoardFormatException
choice
- File to load board from.
BadBoardFormatException
- if the board file is malformatted.public void load(java.io.BufferedReader br) throws BadBoardFormatException
br
- BufferedReader to read board from.
BadBoardFormatException
- if the board is malformatted.
|
Breakout Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |