|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gecco.server.core.EventHandler
This class represents an event handler for a unit. All event handlers should be subclasses of this class. An event handler should take care of the occasions when an event is sent to a unit, for example, when the unit stands on an automaton that affects unit in some way.
Constructor Summary | |
EventHandler()
Constructor for the EventHandler object |
Method Summary | |
abstract void |
handleEvent(UnitEvent event,
Unit unit)
The method that is called by the game engine when a unit of a unit type with this event handler receives a message. |
protected void |
sendUnitMessage(Unit unit,
String unitMessage)
Sends a message to all observers of the given unit (as well as to all God's Eye roles). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EventHandler()
Method Detail |
public abstract void handleEvent(UnitEvent event, Unit unit)
event
- The event.unit
- The unit affected by the event.protected void sendUnitMessage(Unit unit, String unitMessage)
unit
- The unit.unitMessage
- The message to be sent.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |