wyvern.lib.predicates
Class LessOrEqualPredicate

java.lang.Object
  extended bywyvern.lib.predicates.ComparisonPredicate
      extended bywyvern.lib.predicates.LessOrEqualPredicate
All Implemented Interfaces:
Predicate, PrintablePredicate

public class LessOrEqualPredicate
extends ComparisonPredicate

Returns true if quantity A is <= quantity B. You can compare int properties of a GameObject with this kind of predicate.

Version:
1.0, Dec 26, 2003
Author:
Steve Yegge

Field Summary
 
Fields inherited from class wyvern.lib.predicates.ComparisonPredicate
name_, value_
 
Constructor Summary
LessOrEqualPredicate(java.lang.String prop, int value)
          Constructs a new LessOrEqualPredicate
 
Method Summary
 boolean predicate(GameObject obj)
          Returns true if the object's int property specified in the constructor of this Predicate is less than or equal to the int value passed to the constructor.
 java.lang.String print()
          Prints an English-like description of the predicate, e.g.
 java.lang.String toString()
           
 
Methods inherited from class wyvern.lib.predicates.ComparisonPredicate
getProp, getValue, make
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LessOrEqualPredicate

public LessOrEqualPredicate(java.lang.String prop,
                            int value)
Constructs a new LessOrEqualPredicate

Parameters:
prop - the int property to check
value - the value to compare the property against.
Method Detail

predicate

public boolean predicate(GameObject obj)
Returns true if the object's int property specified in the constructor of this Predicate is less than or equal to the int value passed to the constructor.

Parameters:
obj -
Returns:
true if obj.getIntProperty(prop) <= value

toString

public java.lang.String toString()

print

public java.lang.String print()
Description copied from interface: PrintablePredicate
Prints an English-like description of the predicate, e.g. "NOT name like 'bob'", or "quantity < 100 AND item is cursed"