wyvern.lib.predicates
Class LessOrEqualPredicate
java.lang.Object
wyvern.lib.predicates.ComparisonPredicate
wyvern.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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LessOrEqualPredicate
public LessOrEqualPredicate(java.lang.String prop,
int value)
- Constructs a new LessOrEqualPredicate
- Parameters:
prop
- the int property to checkvalue
- the value to compare the property against.
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"