Package com.tenio.engine.fsm.entity
Class State<T>
- java.lang.Object
-
- com.tenio.engine.fsm.entity.State<T>
-
- Type Parameters:
T
- the entity template
public abstract class State<T> extends java.lang.Object
Check out the State for more details- Author:
- kong
-
-
Constructor Summary
Constructors Constructor Description State()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
enter(T entity)
This will execute when the state is enteredabstract void
execute(T entity)
This is the state's normal update functionabstract void
exit(T entity)
This will execute when the state is exitedabstract boolean
onMessage(T entity, Telegram msg)
This executes if the agent receives a message from the message dispatcher, seeMessageDispatcher
-
-
-
Method Detail
-
enter
public abstract void enter(T entity)
This will execute when the state is entered- Parameters:
entity
- the current entity
-
execute
public abstract void execute(T entity)
This is the state's normal update function- Parameters:
entity
- the current entity
-
exit
public abstract void exit(T entity)
This will execute when the state is exited- Parameters:
entity
- the current entity
-
onMessage
public abstract boolean onMessage(T entity, Telegram msg)
This executes if the agent receives a message from the message dispatcher, seeMessageDispatcher
- Parameters:
entity
- the current entitymsg
- the message that sent to this current entity- Returns:
- true if the message was sent successful, false otherwise
-
-