wyvern.lib.predicates
Class ArchetypePredicate

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

public class ArchetypePredicate
extends java.lang.Object
implements Predicate

Checks for an object of the specified Archetype, using wyvern.lib.Kernel.isInstance().

Version:
1.0, Nov 05, 2001
Author:
Steve Yegge

Field Summary
protected  java.lang.String arch_
           
 
Constructor Summary
ArchetypePredicate(java.lang.String arch)
          Constructs a new ArchetypePredicate for a given archetype.
 
Method Summary
 boolean predicate(GameObject obj)
          Return true if the passed object has one of the listed properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arch_

protected java.lang.String arch_
Constructor Detail

ArchetypePredicate

public ArchetypePredicate(java.lang.String arch)
Constructs a new ArchetypePredicate for a given archetype.

Parameters:
arch - the name of the archetype in question, e.g. "objects/treasure/gold_coins".
Method Detail

predicate

public boolean predicate(GameObject obj)
Return true if the passed object has one of the listed properties.

Specified by:
predicate in interface Predicate
Parameters:
obj - any GameObject
Returns:
true if the object inherits from the specified archetype