jchrest.lib
Class Scenes

java.lang.Object
  extended by jchrest.lib.Scenes

public class Scenes
extends java.lang.Object

The Scenes class holds a list of Scene objects. Each Scene contains an array of 'situations'.


Method Summary
 Scene get(int i)
           
 Move getMove(int i)
           
 java.lang.String[] getSceneNames()
           
 boolean haveMoves()
           
static Scenes read(java.io.BufferedReader input)
          Read in a list of scenes from the given input stream.
static Scenes readWithMove(java.io.BufferedReader input)
          Read in a list of scenes from the given input stream.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public static Scenes read(java.io.BufferedReader input)
                   throws java.io.IOException
Read in a list of scenes from the given input stream. Format is: line 1: height width e.g. 8 8 line 2: blank (can be comment) line 3-3+height: line of length 'width'. Each char in line 2 or '.' (empty) line 3+height+1: blank (can be comment) and repeat until EOF Throws IOException if any line is short, or the number of lines cannot be read.

Throws:
java.io.IOException

readWithMove

public static Scenes readWithMove(java.io.BufferedReader input)
                           throws java.io.IOException
Read in a list of scenes from the given input stream. Format is: line 1: height width e.g. 8 8 line 2: blank (can be comment) line 3-3+height: line of length 'width'. Each char in line 2 or '.' (empty) line 3+height+1: piece row column defines a move (row from 0 at the top, column from 0 at the left) line 3+height+2: blank (can be comment) and repeat until EOF Throws IOException if any line is short, or the number of lines cannot be read.

Throws:
java.io.IOException

getSceneNames

public java.lang.String[] getSceneNames()

get

public Scene get(int i)

haveMoves

public boolean haveMoves()

getMove

public Move getMove(int i)

size

public int size()