Enum EnemyState

java.lang.Object
java.lang.Enum<EnemyState>
com.mygdx.game.AI.EnemyState
All Implemented Interfaces:
com.badlogic.gdx.ai.fsm.State<NPCShip>, java.io.Serializable, java.lang.Comparable<EnemyState>, java.lang.constant.Constable

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

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

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

    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, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

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

    • 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
    • HUNT

      public static final EnemyState HUNT
      Actively looks for other enemies
    • ATTACK

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

    • values

      public static EnemyState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      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>