mhframework
Class MHActorList

java.lang.Object
  extended by mhframework.MHActorList
All Implemented Interfaces:
MHRenderable

public class MHActorList
extends java.lang.Object
implements MHRenderable

This class keeps a collection of MHActor objects.


Constructor Summary
MHActorList()
          Constructor.
 
Method Summary
 void add(MHActor actor)
          Adds a new actor to the list.
 void advance()
          Advances all actors in the list.
 void advance(int index)
          Advances the actor at the given index.
 void clear()
          Clears the list of actor references.
 MHActor get(int index)
          Returns the actor at the given index.
 int getSize()
          Returns the number of actors in the list.
 boolean isEmpty()
          States whether the actor list is empty.
 MHActor remove(int index)
          Removes the actor at the given index and returns a reference to it.
 void render(java.awt.Graphics2D g)
          Renders all actors in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MHActorList

public MHActorList()
Constructor.

Method Detail

add

public void add(MHActor actor)
Adds a new actor to the list.

Parameters:
actor - The new actor to be added to the list.

get

public MHActor get(int index)
Returns the actor at the given index.

Parameters:
index - The index of the actor being requested.
Returns:
The actor at the given index.

clear

public void clear()
Clears the list of actor references.


isEmpty

public boolean isEmpty()
States whether the actor list is empty.

Returns:
True if list is empty, false otherwise.

remove

public MHActor remove(int index)
Removes the actor at the given index and returns a reference to it.

Parameters:
index - The index of the actor being removed.
Returns:
The actor who was removed.

advance

public void advance(int index)
Advances the actor at the given index.

Parameters:
index - The index of the actor being advanced.

advance

public void advance()
Advances all actors in the list.

Specified by:
advance in interface MHRenderable

render

public void render(java.awt.Graphics2D g)
Renders all actors in the list.

Specified by:
render in interface MHRenderable
Parameters:
g - The Graphics2D object on which to render the actor.

getSize

public int getSize()
Returns the number of actors in the list.

Returns:
The number of actors in the list.