ctf.environment
Class FileSet

java.lang.Object
  |
  +--ctf.environment.FileSet

class FileSet
extends Object
implements ObstacleSet, BoardSet

Board and obstacle settings read from a file. Note that this class only has package access enabled.

Author:
Jason Rohrer

Constructor Summary
(package private) FileSet(File inFile)
          Constructs a new FileSet.
 
Method Summary
 int getBoardSize()
          Gets the dimension of the board.
 EnvironmentLocation[] getObstacleLocations(int inBoardSize)
          Gets an array of obstacle locations specified by this set.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSet

FileSet(File inFile)
  throws IOException
Constructs a new FileSet.
Parameters:
inFile - the file to read board set from.
Throws:
IOException - if any of the io operations involved fail.
Method Detail

getObstacleLocations

public EnvironmentLocation[] getObstacleLocations(int inBoardSize)
Description copied from interface: ObstacleSet
Gets an array of obstacle locations specified by this set.
Specified by:
getObstacleLocations in interface ObstacleSet
Tags copied from interface: ObstacleSet
Parameters:
inBoardSize - the dimension of the board.
Returns:
an array of obstacle locations.

getBoardSize

public int getBoardSize()
Description copied from interface: BoardSet
Gets the dimension of the board.
Specified by:
getBoardSize in interface BoardSet
Tags copied from interface: BoardSet
Returns:
the size of the board in number of spaces across.