jadex.micro.examples.hunterprey
Class CreatureActionComparator

java.lang.Object
  extended by jadex.micro.examples.hunterprey.CreatureActionComparator
All Implemented Interfaces:
Comparator

public class CreatureActionComparator
extends Object
implements Comparator

Sort creature actions to execute hunters before preys.


Field Summary
protected  IEnvironmentSpace space
          The space.
 
Constructor Summary
CreatureActionComparator(IEnvironmentSpace space)
          Create a new creature action comparator.
 
Method Summary
 int compare(Object obj1, Object obj2)
          Return a negative number when the first action should be executed before the second.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

space

protected IEnvironmentSpace space
The space.

Constructor Detail

CreatureActionComparator

public CreatureActionComparator(IEnvironmentSpace space)
Create a new creature action comparator.

Method Detail

compare

public int compare(Object obj1,
                   Object obj2)
Return a negative number when the first action should be executed before the second.

Specified by:
compare in interface Comparator


Copyright © 2010. All Rights Reserved.