vooga.examples.level
Class LevelManager

java.lang.Object
  extended by vooga.examples.level.LevelManager

public class LevelManager
extends java.lang.Object


Constructor Summary
LevelManager()
           
 
Method Summary
 void addLevels()
          This method fills a Collection of Levels by scanning through a folder containing .txt files.
 java.util.Collection<BetterSprite> nextLevel()
           
 void persistCollisionManager(Level l)
           
 void persistentResources(Level l)
          Assign the persistent Resource Handler to the level l.
 void persistEventManager(Level l)
          Assign the persistent Event Manager to the level l.
 void persistGameState(Level l)
          Assign the persistent Game State object to the level l.
 void removeLevel(int levelIndex)
          Used to remove a Level from the Collection.
 void setPersistentCollisionManager(CollisionManager cm)
           
 void setPersistentEventManager(EventManager em)
          Set the persist Event Manager.
 void setPersistentGameState(GameState gs)
          Set the persist Game State object.
 void setPersistentResources(Resources rh)
          Set the persist Resource Handler.
 java.util.Collection<BetterSprite> skipToLevel(int levelIndex)
          Used to skip to any Level within the current Collection of Levels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LevelManager

public LevelManager()
Method Detail

addLevels

public void addLevels()
               throws java.io.FileNotFoundException
This method fills a Collection of Levels by scanning through a folder containing .txt files. The user must start all files with "level" and end all files with ".txt".

Throws:
java.io.FileNotFoundException

removeLevel

public void removeLevel(int levelIndex)
Used to remove a Level from the Collection.

Parameters:
levelIndex - - Indicates which Level should be removed.

skipToLevel

public java.util.Collection<BetterSprite> skipToLevel(int levelIndex)
Used to skip to any Level within the current Collection of Levels.

Parameters:
levelIndex - - indicates the Level to jump to.
Returns:
the Collection of Sprites that constitutes the selected Level.

nextLevel

public java.util.Collection<BetterSprite> nextLevel()
Returns:
The Collection of Sprites that constitutes the next Level in the folder.

setPersistentCollisionManager

public void setPersistentCollisionManager(CollisionManager cm)

setPersistentEventManager

public void setPersistentEventManager(EventManager em)
Set the persist Event Manager. Called by a level when it exits.

Parameters:
em -

setPersistentGameState

public void setPersistentGameState(GameState gs)
Set the persist Game State object. Called by a level when it exits.

Parameters:
gs -

setPersistentResources

public void setPersistentResources(Resources rh)
Set the persist Resource Handler. Called by a level when it exits.

Parameters:
rh -

persistCollisionManager

public void persistCollisionManager(Level l)

persistEventManager

public void persistEventManager(Level l)
Assign the persistent Event Manager to the level l.

Parameters:
l -

persistGameState

public void persistGameState(Level l)
Assign the persistent Game State object to the level l.

Parameters:
l -

persistentResources

public void persistentResources(Level l)
Assign the persistent Resource Handler to the level l.

Parameters:
l -