com.brackeen.javagamebook.game
Interface GameObjectManager

All Known Implementing Classes:
GridGameObjectManager, SimpleGameObjectManager

public interface GameObjectManager

The GameObjectManager interface provides methods to keep track of and draw GameObjects.


Method Summary
 void add(GameObject object)
          Adds a GameObject to this manager.
 void addPlayer(GameObject player)
          Adds a GameObject to this manager, specifying it as the player object.
 void draw(java.awt.Graphics2D g, GameObjectRenderer r)
          Draws all visible objects.
 GameObject getPlayer()
          Gets the object specified as the Player object, or null if no player object was specified.
 java.util.Iterator iterator()
          Gets an iterator of all GameObjects (including the player).
 void markAllVisible()
          Marks all objects as potentially visible (should be drawn).
 void markVisible(java.awt.Rectangle bounds)
          Marks all objects within the specified 2D bounds as potentially visible (should be drawn).
 void remove(GameObject object)
          Removes a GameObject from this manager.
 void update(long elapsedTime)
          Updates all objects based on the amount of time passed from the last update.
 

Method Detail

markVisible

public void markVisible(java.awt.Rectangle bounds)
Marks all objects within the specified 2D bounds as potentially visible (should be drawn).


markAllVisible

public void markAllVisible()
Marks all objects as potentially visible (should be drawn).


add

public void add(GameObject object)
Adds a GameObject to this manager.


iterator

public java.util.Iterator iterator()
Gets an iterator of all GameObjects (including the player).


addPlayer

public void addPlayer(GameObject player)
Adds a GameObject to this manager, specifying it as the player object. An existing player object, if any, is not removed.


getPlayer

public GameObject getPlayer()
Gets the object specified as the Player object, or null if no player object was specified.


remove

public void remove(GameObject object)
Removes a GameObject from this manager.


update

public void update(long elapsedTime)
Updates all objects based on the amount of time passed from the last update.


draw

public void draw(java.awt.Graphics2D g,
                 GameObjectRenderer r)
Draws all visible objects.