- java.lang.Object
-
- ilusr.gamestatemanager.GameState
-
- All Implemented Interfaces:
ilusr.core.interfaces.IDispose
,IGameState
public class GameState extends Object implements IGameState
- Author:
- Jeff Riggle
-
-
Constructor Summary
Constructors Constructor Description GameState(T content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCompletedEventListener(IGameStateListener listener)
Add a listener for the game state completed event.void
addFinishEventListener(IFinishListener listener)
void
dispose()
void
finish()
Finishes the game only signal this if you want to end the game completely.void
removeCompletedEventListener(IGameStateListener listener)
Remove a listener from the game state completed event.void
removeFinishEventListener(IFinishListener listener)
<T> void
run(T data)
Runs the game state with some data.<T> void
stateCompleted(T data)
Fire the game state completed event.<T> T
stateContent()
<T> void
stateContent(T value)
-
-
-
Method Detail
-
addCompletedEventListener
public void addCompletedEventListener(IGameStateListener listener)
Description copied from interface:IGameState
Add a listener for the game state completed event.- Specified by:
addCompletedEventListener
in interfaceIGameState
-
removeCompletedEventListener
public void removeCompletedEventListener(IGameStateListener listener)
Description copied from interface:IGameState
Remove a listener from the game state completed event.- Specified by:
removeCompletedEventListener
in interfaceIGameState
-
stateCompleted
public <T> void stateCompleted(T data)
Description copied from interface:IGameState
Fire the game state completed event.- Specified by:
stateCompleted
in interfaceIGameState
-
stateContent
public <T> T stateContent()
- Specified by:
stateContent
in interfaceIGameState
- Returns:
- The content for the game state.
-
stateContent
public <T> void stateContent(T value)
- Specified by:
stateContent
in interfaceIGameState
- Parameters:
value
- The new content for the game state.
-
run
public <T> void run(T data)
Description copied from interface:IGameState
Runs the game state with some data.- Specified by:
run
in interfaceIGameState
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceilusr.core.interfaces.IDispose
-
addFinishEventListener
public void addFinishEventListener(IFinishListener listener)
- Specified by:
addFinishEventListener
in interfaceIGameState
- Parameters:
listener
- A @see IFinishListener to run if this game state finishes the game.
-
removeFinishEventListener
public void removeFinishEventListener(IFinishListener listener)
- Specified by:
removeFinishEventListener
in interfaceIGameState
- Parameters:
listener
- A @see IFinishListener to remove.
-
finish
public void finish()
Description copied from interface:IGameState
Finishes the game only signal this if you want to end the game completely.- Specified by:
finish
in interfaceIGameState
-
-