Enum EnemyState

  • All Implemented Interfaces:
    com.badlogic.gdx.ai.fsm.State<NPCShip>, java.io.Serializable, java.lang.Comparable<EnemyState>

    public enum EnemyState
    extends java.lang.Enum<EnemyState>
    implements com.badlogic.gdx.ai.fsm.State<NPCShip>
    State machine used for NPC ships' behaviour
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ATTACK
      Attempts to kill the enemy
      PURSUE
      Tries to get into attack range of the player
      WANDER
      Picks random pos and travels to it
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void enter​(NPCShip entity)
      Called when a state is entered
      void exit​(NPCShip e)
      Called when a state is left
      boolean onMessage​(NPCShip e, com.badlogic.gdx.ai.msg.Telegram telegram)
      not used
      void update​(NPCShip e)
      Called every from for every NPC ship (there or there abouts)
      static EnemyState valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static EnemyState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • WANDER

        public static final EnemyState WANDER
        Picks random pos and travels to it
      • PURSUE

        public static final EnemyState PURSUE
        Tries to get into attack range of the player
      • ATTACK

        public static final EnemyState ATTACK
        Attempts to kill the enemy
    • Method Detail

      • values

        public static EnemyState[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (EnemyState c : EnemyState.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EnemyState valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • update

        public void update​(NPCShip e)
        Called every from for every NPC ship (there or there abouts)
        Specified by:
        update in interface com.badlogic.gdx.ai.fsm.State<NPCShip>
        Parameters:
        e - the sender
      • exit

        public void exit​(NPCShip e)
        Called when a state is left
        Specified by:
        exit in interface com.badlogic.gdx.ai.fsm.State<NPCShip>
        Parameters:
        e - the sender
      • enter

        public void enter​(NPCShip entity)
        Called when a state is entered
        Specified by:
        enter in interface com.badlogic.gdx.ai.fsm.State<NPCShip>
        Parameters:
        entity - the sender
      • onMessage

        public boolean onMessage​(NPCShip e,
                                 com.badlogic.gdx.ai.msg.Telegram telegram)
        not used
        Specified by:
        onMessage in interface com.badlogic.gdx.ai.fsm.State<NPCShip>