|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brackeen.javagamebook.game.SimpleGameObjectManager
The SimpleGameObjectManager is a GameObjectManager that keeps all object in a list and performs no collision detection.
Constructor Summary | |
SimpleGameObjectManager()
Creates a new SimpleGameObjectManager. |
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 and marks all objects as not visible. |
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleGameObjectManager()
Method Detail |
public void markAllVisible()
markAllVisible
in interface GameObjectManager
public void markVisible(java.awt.Rectangle bounds)
markVisible
in interface GameObjectManager
public java.util.Iterator iterator()
GameObjectManager
iterator
in interface GameObjectManager
public void add(GameObject object)
add
in interface GameObjectManager
public void addPlayer(GameObject player)
addPlayer
in interface GameObjectManager
public GameObject getPlayer()
getPlayer
in interface GameObjectManager
public void remove(GameObject object)
remove
in interface GameObjectManager
public void update(long elapsedTime)
update
in interface GameObjectManager
public void draw(java.awt.Graphics2D g, GameObjectRenderer r)
draw
in interface GameObjectManager
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |