wyvern.lib.predicates
Class BlocksSpellPredicate
java.lang.Object
wyvern.lib.predicates.BlocksSpellPredicate
- All Implemented Interfaces:
- LocationPredicate, Predicate
- public class BlocksSpellPredicate
- extends java.lang.Object
- implements LocationPredicate
This predicate checks for the presence of objects that block spells.
- Version:
- 1.0, Jan 31, 1998
- Author:
- Steve Yegge
Method Summary |
static boolean |
canWalk(GameObject obj,
int x,
int y)
Returns true if the target object's can-walk property
includes the specified point, in map coordinates. |
boolean |
predicate(GameObject obj)
This method is provided in case someone tries to use a
BlocksSpellPredicate as a normal Predicate function. |
boolean |
predicate(int x,
int y,
GameObject obj)
Does a more specialized check on the object, looking at the
can-walk list to see if it actually allows motion there. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PREDICATE
public static final BlocksSpellPredicate PREDICATE
BlocksSpellPredicate
public BlocksSpellPredicate()
predicate
public boolean predicate(GameObject obj)
- This method is provided in case someone tries to use a
BlocksSpellPredicate as a normal Predicate function. It
won't be able to figure out properly if the object is blocking,
because it can't check the object's can_walk list.
- Specified by:
predicate
in interface Predicate
- Parameters:
obj
- any GameObject
- Returns:
- true if the object blocks spells
predicate
public boolean predicate(int x,
int y,
GameObject obj)
- Does a more specialized check on the object, looking at the
can-walk list to see if it actually allows motion there.
- Specified by:
predicate
in interface LocationPredicate
- Parameters:
x
- map x locationy
- map y locationobj
- object at (x, y)
- Returns:
- true if the object blocks spells at (x, y)
canWalk
public static boolean canWalk(GameObject obj,
int x,
int y)
- Returns true if the target object's can-walk property
includes the specified point, in map coordinates.
- Parameters:
obj
- an object to examinex
- map x coordinatey
- map y coordinate
- Returns:
- true if the object has a "can-walk" PointList,
and the list contains the passed (x, y) map location.
If there's no can-walk list, or the list doesn't contain
the passed point, returns false.