- 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 voidaddCompletedEventListener(IGameStateListener listener)Add a listener for the game state completed event.voidaddFinishEventListener(IFinishListener listener)voiddispose()voidfinish()Finishes the game only signal this if you want to end the game completely.voidremoveCompletedEventListener(IGameStateListener listener)Remove a listener from the game state completed event.voidremoveFinishEventListener(IFinishListener listener)<T> voidrun(T data)Runs the game state with some data.<T> voidstateCompleted(T data)Fire the game state completed event.<T> TstateContent()<T> voidstateContent(T value)
-
-
-
Method Detail
-
addCompletedEventListener
public void addCompletedEventListener(IGameStateListener listener)
Description copied from interface:IGameStateAdd a listener for the game state completed event.- Specified by:
addCompletedEventListenerin interfaceIGameState
-
removeCompletedEventListener
public void removeCompletedEventListener(IGameStateListener listener)
Description copied from interface:IGameStateRemove a listener from the game state completed event.- Specified by:
removeCompletedEventListenerin interfaceIGameState
-
stateCompleted
public <T> void stateCompleted(T data)
Description copied from interface:IGameStateFire the game state completed event.- Specified by:
stateCompletedin interfaceIGameState
-
stateContent
public <T> T stateContent()
- Specified by:
stateContentin interfaceIGameState- Returns:
- The content for the game state.
-
stateContent
public <T> void stateContent(T value)
- Specified by:
stateContentin interfaceIGameState- Parameters:
value- The new content for the game state.
-
run
public <T> void run(T data)
Description copied from interface:IGameStateRuns the game state with some data.- Specified by:
runin interfaceIGameState
-
dispose
public void dispose()
- Specified by:
disposein interfaceilusr.core.interfaces.IDispose
-
addFinishEventListener
public void addFinishEventListener(IFinishListener listener)
- Specified by:
addFinishEventListenerin interfaceIGameState- Parameters:
listener- A @see IFinishListener to run if this game state finishes the game.
-
removeFinishEventListener
public void removeFinishEventListener(IFinishListener listener)
- Specified by:
removeFinishEventListenerin interfaceIGameState- Parameters:
listener- A @see IFinishListener to remove.
-
finish
public void finish()
Description copied from interface:IGameStateFinishes the game only signal this if you want to end the game completely.- Specified by:
finishin interfaceIGameState
-
-