wyvern.lib.predicates
Class AttackablePlayerPredicate

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

public class AttackablePlayerPredicate
extends java.lang.Object
implements Predicate

A predicate that determines whether a monster wants to attack a given player.

Version:
1.0, Nov 14, 1999
Author:
Steve Yegge

Constructor Summary
AttackablePlayerPredicate(Commandable agent)
          Constructs a new AttackablePlayerPredicate
 
Method Summary
static boolean predicate(Commandable agent, GameObject obj)
          Static version of the predicate.
 boolean predicate(GameObject obj)
          Returns true if we want to attack the passed player.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttackablePlayerPredicate

public AttackablePlayerPredicate(Commandable agent)
Constructs a new AttackablePlayerPredicate

Parameters:
agent - the monster that will be looking for someone to attack
Method Detail

predicate

public boolean predicate(GameObject obj)
Returns true if we want to attack the passed player.

Specified by:
predicate in interface Predicate
Parameters:
obj - a player (or monster, or even GameObject) to attack
Returns:
true if we think we can attack it

predicate

public static boolean predicate(Commandable agent,
                                GameObject obj)
Static version of the predicate.

Parameters:
agent - the monster doing the attacking
obj - the object (player, usually) to attack
Returns:
true if we think we can attack it