wyvern.lib.predicates
Class PickupPredicate

java.lang.Object
  extended bywyvern.lib.predicates.PickupPredicate
All Implemented Interfaces:
Predicate

public class PickupPredicate
extends java.lang.Object
implements Predicate

Filter to see if an object can be picked up. Right now it just checks to make sure the object isn't a nopickup or living object. Eventually it should check the player's strength, the weight of the object in question, and possibly other attributes (e.g. a Wiz/admin might be able to pick *anything* up).

Version:
1.0, Mar 23, 1999
Author:
Steve Yegge

Field Summary
static PickupPredicate INSTANCE
          A Singleton/flyweight instance.
 
Constructor Summary
PickupPredicate()
           
 
Method Summary
static boolean isGettable(GameObject obj)
          Returns true if the object meets the criteria for being able to be picked up by a normal player.
 boolean predicate(GameObject obj)
          Returns true if the agent can pick up the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final PickupPredicate INSTANCE
A Singleton/flyweight instance. Useful for avoiding object creation, since the PickupPredicate has no internal state.

Constructor Detail

PickupPredicate

public PickupPredicate()
Method Detail

predicate

public boolean predicate(GameObject obj)
Returns true if the agent can pick up the object.

Specified by:
predicate in interface Predicate
Parameters:
obj - any GameObject
Returns:
true if the object passes, else false

isGettable

public static boolean isGettable(GameObject obj)
Returns true if the object meets the criteria for being able to be picked up by a normal player.