group1.model.gameobject
Class PictureList

java.lang.Object
  extended by group1.model.gameobject.PictureList

public class PictureList
extends java.lang.Object

A PictureList is a list of lists of pictures. There is one list of pictures for each valid state as defined in GameObjStates. Each list enumerates the frames of animation to show for a game object in that state.

Each GameObj should have a unique instance of this class, and every picture in that instance must depict that particular GameObj. For instance, either Jeff or an enemy can be in the GameObjStates.RUNNING state, but there are different animations for Jeff running and an enemy running.

Each list of pictures for a particular state will be henceforth referred to as a "film." This class will be able to contain as many films as there are valid states in the game.


Constructor Summary
PictureList()
          Creates an empty picture list database.
 
Method Summary
 java.util.List<java.io.File> getFilm(int gameObjState)
          Accesses the film for a given state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PictureList

public PictureList()
Creates an empty picture list database. Each state is initialized to have a film of zero length.

Method Detail

getFilm

public java.util.List<java.io.File> getFilm(int gameObjState)
                                     throws java.lang.IndexOutOfBoundsException
Accesses the film for a given state. The List will be returned, and then you can use the methods in the List interface to modify the list. For example, to add the first picture file, you would say something like:
     aPictureList.getFilm(GameObjStates.STATE_UNDEFINED).add(aFile);
 

Parameters:
gameObjState - a constant value from GameObjStates OTHER THAN NUMBER_OF_STATES.
Returns:
a list of files (presumably picture files) that represents the film for the specified state.
Throws:
java.lang.IndexOutOfBoundsException - if an illegal state is given, i.e. GameObjStates.isValidState(gameObjState) is false.