Skip to content

Instantly share code, notes, and snippets.

@schoettl
Created September 29, 2012 15:25
Show Gist options
  • Save schoettl/3804349 to your computer and use it in GitHub Desktop.
Save schoettl/3804349 to your computer and use it in GitHub Desktop.
A setter for views to set data models
public void setGameState(GameState gameState) {
if (gameState != this.gameState) {
if (this.gameState != null) {
// unregister listeners/observers
}
this.gameState = gameState;
if (gameState != null) {
// register listeners/observers
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment