de.adom.jade.world.maps
Class MapArea

java.lang.Object
  extended by de.adom.jade.world.maps.MapArea
All Implemented Interfaces:
java.io.Serializable

public class MapArea
extends java.lang.Object
implements java.io.Serializable

Memorizes the coordinates of a rectangular map area. This class is usually used to report map updates.

See Also:
Serialized Form

Field Summary
 int x1
          the left coordinate of the map area
 int x2
          the right coordinate of the map area
 int y1
          the upper coordinate of the map area
 int y2
          the lower coordinate of the map area
 
Constructor Summary
MapArea()
          Creates a new map area instance. // * @param aMap the map to which this map area belongs
 
Method Summary
 boolean isUpdated()
          Determines whether this area has seen any updates.
 void reset()
          Resets the map area to an uninitialized area.
 void setUpdatePoint(int x, int y)
          Memorizes an update point.
 java.lang.String toString()
          Returns a string representation of this area.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x1

public int x1
the left coordinate of the map area


y1

public int y1
the upper coordinate of the map area


x2

public int x2
the right coordinate of the map area


y2

public int y2
the lower coordinate of the map area

Constructor Detail

MapArea

public MapArea()
Creates a new map area instance. // * @param aMap the map to which this map area belongs

Method Detail

reset

public void reset()
Resets the map area to an uninitialized area. Before the values can be retrieved in a meaningful way, at least one update point must be set.


setUpdatePoint

public void setUpdatePoint(int x,
                           int y)
Memorizes an update point. The area is updated so that rectangle encompassing all updates since the last call to reset are included. After a call to reset this method must be called at least once for the coordinates to hold meaningful values.

Parameters:
x - the x coordinate of the update point
y - the y coordinate of the update point

isUpdated

public boolean isUpdated()
Determines whether this area has seen any updates.

Returns:
a boolean flag determining whether any updates have been necessary

toString

public java.lang.String toString()
Returns a string representation of this area.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this area