wyvern.kernel.maps
Class TopFinder

java.lang.Object
  extended bywyvern.kernel.maps.TopFinder

public class TopFinder
extends java.lang.Object

Find the top visible object at a given map location.

Version:
1.0, Nov 10, 1997
Author:
Eric Weber

Nested Class Summary
protected static class TopFinder.LayerVisitor
          Used to visit every object at a map location and keep an ordered list of what it sees.
 
Constructor Summary
TopFinder()
           
 
Method Summary
static GameObject topObject(GameMap map, int x, int y)
          Find the top object in a map location.
static GameObject topObject(GameMap map, int x, int y, Predicate p)
          Find the top (i.e. highest drawing layer) object at a map location that passes a specified predicate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopFinder

public TopFinder()
Method Detail

topObject

public static GameObject topObject(GameMap map,
                                   int x,
                                   int y,
                                   Predicate p)
Find the top (i.e. highest drawing layer) object at a map location that passes a specified predicate.

Parameters:
map - The map to search.
x - The horizontal location.
y - The vertical location.
p - a predicate that returns true if the object is OK.
Returns:
The topmost object at that location, or null if none.

topObject

public static GameObject topObject(GameMap map,
                                   int x,
                                   int y)
Find the top object in a map location.

Parameters:
map - The map to search.
x - The horizontal location.
y - The vertical location.
Returns:
The topmost object at that location, or null if none.