wyvern.lib.predicates
Class ShortDescEqualPredicate

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

public class ShortDescEqualPredicate
extends java.lang.Object
implements Predicate, PrintablePredicate

A very simple version of the NameMatchPredicate that checks whether the object's toString() description exactly matches the specified string.

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

Constructor Summary
ShortDescEqualPredicate(java.lang.String match)
           
 
Method Summary
 boolean predicate(GameObject o)
          Checks an object to see if it passes the predicate.
 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
 

Constructor Detail

ShortDescEqualPredicate

public ShortDescEqualPredicate(java.lang.String match)
Method Detail

predicate

public boolean predicate(GameObject o)
Description copied from interface: Predicate
Checks an object to see if it passes the predicate.

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

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"

Specified by:
print in interface PrintablePredicate