Back to project page DistributedMemory.
The source code is released under:
Apache License
If you think the Android project DistributedMemory listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.faudroids.distributedmemory.core; /*w ww . ja v a 2s . c o m*/ import org.faudroids.distributedmemory.utils.Assert; import javax.inject.Inject; class GameStateManager { private GameState currentState; @Inject public GameStateManager() { currentState = GameState.FINISHED; } public void reset() { currentState = GameState.CONNECTING; } public final GameState getState() { return currentState; } /** * Sets the new local game state. */ public final void changeState(GameState state) { Assert.assertTrue(currentState.isValidNextState(state), "cannot change state from " + currentState + " to " + state); this.currentState = state; } public void setEndState() { this.currentState = GameState.FINISHED; } }