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>,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
-
Method Summary
Modifier and Type Method Description voidenter(NPCShip entity)Called when a state is enteredvoidexit(NPCShip e)Called when a state is leftbooleanonMessage(NPCShip e, com.badlogic.gdx.ai.msg.Telegram telegram)not usedvoidupdate(NPCShip e)Called every from for every NPC ship (there or there abouts)static EnemyStatevalueOf(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, valueOfMethods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
-
Enum Constant Details
-
WANDER
Picks random pos and travels to it -
PURSUE
Tries to get into attack range of the player -
HUNT
Actively looks for other enemies -
ATTACK
Attempts to kill the enemy
-
-
Method Details
-
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
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
Called every from for every NPC ship (there or there abouts)- Specified by:
updatein interfacecom.badlogic.gdx.ai.fsm.State<NPCShip>- Parameters:
e- the sender
-
exit
Called when a state is left- Specified by:
exitin interfacecom.badlogic.gdx.ai.fsm.State<NPCShip>- Parameters:
e- the sender
-
enter
Called when a state is entered- Specified by:
enterin interfacecom.badlogic.gdx.ai.fsm.State<NPCShip>- Parameters:
entity- the sender
-
onMessage
not used- Specified by:
onMessagein interfacecom.badlogic.gdx.ai.fsm.State<NPCShip>
-