Class BeastManager

java.lang.Object
  extended by BeastManager
All Implemented Interfaces:
IBeastProvider

public class BeastManager
extends java.lang.Object
implements IBeastProvider

Manages a simulation group of beasts, handling their updating and providing appropriate information to their pack finders.

Author:
CPSC 111 instructors

Constructor Summary
BeastManager(acm.graphics.GContainer container)
          Create a new beast manager for the given container.
 
Method Summary
 void addBeast(Beast beast)
          Add the given beast to the set of managed beasts.
 Beast[] getBeasts()
          Provide a list of the beasts managed.
 void removeBeast(Beast beast)
          Remove the given beast from the set of managed beasts.
 void updateBeasts()
          Update the state of all beasts in the simulation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeastManager

public BeastManager(acm.graphics.GContainer container)
Create a new beast manager for the given container.

The container is used within BeastManager to store the set of beasts.

Parameters:
container - a non-null container that's ready for a proliferation of beasts
Method Detail

addBeast

public void addBeast(Beast beast)
Add the given beast to the set of managed beasts.

Parameters:
beast - a non-null beast to add

removeBeast

public void removeBeast(Beast beast)
Remove the given beast from the set of managed beasts.

Parameters:
beast - a non-null beast to remove

getBeasts

public Beast[] getBeasts()
Provide a list of the beasts managed.

Specified by:
getBeasts in interface IBeastProvider
Returns:
a non-null (but possibly empty!) list of non-null Beasts

updateBeasts

public void updateBeasts()
Update the state of all beasts in the simulation.