group1.model
Class EnvironmentLoader

java.lang.Object
  extended by group1.model.EnvironmentLoader

public class EnvironmentLoader
extends java.lang.Object

A class for loading an environment from a text file.


Method Summary
 Environment createEnvironment(Jeff jeff, java.lang.String filename, PictureList[] pictureCache)
          Create an Environment, given a text file and the necessary objects.
static EnvironmentLoader getInstance()
          Get an instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static EnvironmentLoader getInstance()
Get an instance of this class. (Singleton design pattern.)

Returns:
The instance of this class.

createEnvironment

public final Environment createEnvironment(Jeff jeff,
                                           java.lang.String filename,
                                           PictureList[] pictureCache)
                                    throws java.io.EOFException,
                                           java.io.IOException,
                                           java.io.FileNotFoundException
Create an Environment, given a text file and the necessary objects.

Parameters:
jeff - The object for the main character of the game.
filename - The name of the file representing the Environment to be loaded.
pictureCache - The cache of pictures.
Returns:
The created Environment object.
Throws:
java.io.EOFException - If we unexpectedly reach the end of a file.
java.io.IOException - If other reading errors occur.
java.io.FileNotFoundException - If the file's not found.