Package com.mygdx.game.AI
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>
public enum EnemyState extends java.lang.Enum<EnemyState> implements com.badlogic.gdx.ai.fsm.State<NPCShip>
State machine used for NPC ships' behaviour
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enter(NPCShip entity)
Called when a state is enteredvoid
exit(NPCShip e)
Called when a state is leftboolean
onMessage(NPCShip e, com.badlogic.gdx.ai.msg.Telegram telegram)
not usedvoid
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.
-
-
-
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 namejava.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 interfacecom.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 interfacecom.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 interfacecom.badlogic.gdx.ai.fsm.State<NPCShip>
- Parameters:
entity
- the sender
-
-