Class State
java.lang.Object
de.gurkenlabs.litiengine.entities.behavior.State
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addStateListener
(StateListener listener) Adds a listener to be notified of state events.void
enter()
Called when the state is entered.void
exit()
Called when the state is exited.getName()
Gets the name of the state.Gets the list of transitions associated with this state.protected abstract void
perform()
Performs the actions associated with this state.void
removeStateListener
(StateListener listener) Removes a listener from being notified of state events.
-
Constructor Details
-
State
Initializes a new instance of the State class with the specified name.- Parameters:
name
- the name of the state
-
-
Method Details
-
enter
public void enter()Called when the state is entered. Notifies all registered listeners about the state entry. -
exit
public void exit()Called when the state is exited. Notifies all registered listeners about the state exit. -
getName
-
getTransitions
Gets the list of transitions associated with this state.- Returns:
- the list of transitions
-
addStateListener
Adds a listener to be notified of state events.- Parameters:
listener
- the listener to be added
-
removeStateListener
Removes a listener from being notified of state events.- Parameters:
listener
- the listener to be removed
-
perform
protected abstract void perform()Performs the actions associated with this state.
-