Class CreatureActionComparator

  • All Implemented Interfaces:
    java.util.Comparator

    public class CreatureActionComparator
    extends java.lang.Object
    implements java.util.Comparator
    Sort creature actions to execute hunters before preys.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.lang.Object obj1, java.lang.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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • CreatureActionComparator

        public CreatureActionComparator​(IEnvironmentSpace space)
        Create a new creature action comparator.
    • Method Detail

      • compare

        public int compare​(java.lang.Object obj1,
                           java.lang.Object obj2)
        Return a negative number when the first action should be executed before the second.
        Specified by:
        compare in interface java.util.Comparator