wyvern.lib
Class PointCache

java.lang.Object
  extended bywyvern.lib.PointCache

public final class PointCache
extends java.lang.Object

Maintains a cache of Point objects for use in looking up things in maps. Rather than creating a new Point object for a lookup, call getPoint(x, y) to fetch a reference to a shared Point object. Just make sure never to change the (x) or (y) value for any of these points, or you'll get undefined results.

Version:
1.0, May 12, 2000
Author:
Steve Yegge

Method Summary
static Point getPoint(int x, int y)
          Returns the cached Point at (x, y).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPoint

public static Point getPoint(int x,
                             int y)
Returns the cached Point at (x, y).

Parameters:
x - the point x value
y - the point y value
Returns:
a (shared) point initialized from (x, y). Don't modify the x, y values!