wyvern.lib.event
Class MapChangeEvent

java.lang.Object
  extended byjava.util.EventObject
      extended bywyvern.lib.event.MapChangeEvent
All Implemented Interfaces:
java.io.Serializable

public class MapChangeEvent
extends java.util.EventObject

An event that indicates that an object has entered or left its map.

Version:
1.0, Oct 28, 2003
Author:
Steve Yegge
See Also:
Serialized Form

Nested Class Summary
static class MapChangeEvent.EventType
           
 
Field Summary
static MapChangeEvent.EventType ENTER
           
static MapChangeEvent.EventType EXIT
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
MapChangeEvent(GameMap map, GameObject obj, int x, int y, MapChangeEvent.EventType type)
          Constructs a new MapChangeEvent
 
Method Summary
 MapChangeEvent.EventType getEventType()
          Returns the type of this event.
 GameMap getMap()
          Returns the map where this occurred.
 GameObject getTarget()
          Returns the object that moved.
 int getX()
          Returns the map x location where the object entered or exited the map.
 int getY()
          Returns the map y location where the object entered or exited the map.
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ENTER

public static final MapChangeEvent.EventType ENTER

EXIT

public static final MapChangeEvent.EventType EXIT
Constructor Detail

MapChangeEvent

public MapChangeEvent(GameMap map,
                      GameObject obj,
                      int x,
                      int y,
                      MapChangeEvent.EventType type)
Constructs a new MapChangeEvent

Parameters:
obj - the object that entered or left the map
x - the map x location at which the object entered or left
y - the map y location at which the object entered or left
type - the MapChangeEvent.EventType for this event
Method Detail

getMap

public GameMap getMap()
Returns the map where this occurred.


getTarget

public GameObject getTarget()
Returns the object that moved.


getX

public int getX()
Returns the map x location where the object entered or exited the map. For large objects, returns the object's reference location.


getY

public int getY()
Returns the map y location where the object entered or exited the map. For large objects, returns the object's reference location.


getEventType

public MapChangeEvent.EventType getEventType()
Returns the type of this event.

Returns:
ENTER or EXIT

toString

public java.lang.String toString()