com.brackeen.javagamebook.scripting
Class GameObjectEventMulticaster

java.lang.Object
  extended bycom.brackeen.javagamebook.scripting.GameObjectEventMulticaster
All Implemented Interfaces:
java.util.EventListener, GameObjectEventListener

public class GameObjectEventMulticaster
extends java.lang.Object
implements GameObjectEventListener

Adapter to multicast GameObject notifications to multiple listeners.


Constructor Summary
GameObjectEventMulticaster(GameObjectEventListener l1, GameObjectEventListener l2)
           
 
Method Summary
 void addListener(GameObjectEventListener l)
           
 void notifyCeilingCollision(GameObject object)
          Notifies this GameObject that when it moved, it collided with a ceiling.
 void notifyFloorCollision(GameObject object)
          Notifies this GameObject that when it moved, it collided with a floor.
 void notifyObjectCollision(GameObject object, GameObject otherObject)
          Notifies this GameObject that when it moved, it collided with the specified object.
 void notifyObjectRelease(GameObject object, GameObject otherObject)
          Notifies this GameObject that it is no longer touching the specified object.
 void notifyObjectTouch(GameObject object, GameObject otherObject)
          Notifies this GameObject that it is touching the specified object.
 void notifyVisible(GameObject object, boolean visible)
          Notifies this GameObject whether it was visible or not on the last update.
 void notifyWallCollision(GameObject object)
          Notifies this GameObject that when it moved, it collided with a wall.
 void removeListener(GameObjectEventListener l)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameObjectEventMulticaster

public GameObjectEventMulticaster(GameObjectEventListener l1,
                                  GameObjectEventListener l2)
Method Detail

addListener

public void addListener(GameObjectEventListener l)

removeListener

public void removeListener(GameObjectEventListener l)

notifyVisible

public void notifyVisible(GameObject object,
                          boolean visible)
Notifies this GameObject whether it was visible or not on the last update.

Specified by:
notifyVisible in interface GameObjectEventListener

notifyObjectCollision

public void notifyObjectCollision(GameObject object,
                                  GameObject otherObject)
Notifies this GameObject that when it moved, it collided with the specified object.

Specified by:
notifyObjectCollision in interface GameObjectEventListener

notifyObjectTouch

public void notifyObjectTouch(GameObject object,
                              GameObject otherObject)
Description copied from interface: GameObjectEventListener
Notifies this GameObject that it is touching the specified object. This method is not called again if the two objects were touching in the last frame.

Specified by:
notifyObjectTouch in interface GameObjectEventListener

notifyObjectRelease

public void notifyObjectRelease(GameObject object,
                                GameObject otherObject)
Description copied from interface: GameObjectEventListener
Notifies this GameObject that it is no longer touching the specified object.

Specified by:
notifyObjectRelease in interface GameObjectEventListener

notifyFloorCollision

public void notifyFloorCollision(GameObject object)
Notifies this GameObject that when it moved, it collided with a floor.

Specified by:
notifyFloorCollision in interface GameObjectEventListener

notifyCeilingCollision

public void notifyCeilingCollision(GameObject object)
Notifies this GameObject that when it moved, it collided with a ceiling.

Specified by:
notifyCeilingCollision in interface GameObjectEventListener

notifyWallCollision

public void notifyWallCollision(GameObject object)
Notifies this GameObject that when it moved, it collided with a wall.

Specified by:
notifyWallCollision in interface GameObjectEventListener