public abstract class GameController
extends com.threerings.crowd.client.PlaceController
implements com.threerings.presents.dobj.AttributeChangeListener
DISPATCHER| Constructor and Description |
|---|
GameController() |
| Modifier and Type | Method and Description |
|---|---|
void |
attributeChanged(com.threerings.presents.dobj.AttributeChangedEvent event) |
void |
didLeavePlace(com.threerings.crowd.data.PlaceObject plobj)
Removes our listener registration from the game object and cleans house.
|
int |
getMatchType()
Convenience method to determine the type of game.
|
int |
getSessionId()
Returns the unique session identifier for the current gameplay session.
|
boolean |
handleAction(ActionEvent action)
Handles basic game controller action events.
|
void |
init(com.threerings.crowd.util.CrowdContext ctx,
com.threerings.crowd.data.PlaceConfig config)
Initializes this game controller with the game configuration that was established during the
match making process.
|
boolean |
isGameOver()
Returns whether the game is over.
|
void |
resetGame()
Calls
gameWillReset(), ends the current game (locally, it does not tell the server to
end the game), and waits to receive a reset notification (which is simply an event setting
the game state to IN_PLAY even though it's already set to IN_PLAY)
from the server which will start up a new game. |
void |
setGameOver(boolean gameOver)
Sets the client game over override.
|
void |
systemMessage(String bundle,
String msg)
A way for controllers to display a game-related system message.
|
void |
willEnterPlace(com.threerings.crowd.data.PlaceObject plobj)
Adds this controller as a listener to the game object (thus derived classes need not do so)
and lets the game manager know that we are now ready to go.
|
getPlaceConfig, getPlaceView, mayLeavePlaceactionPerformed, configureAction, createActionButton, handleAction, handleAction, handleAction, postAction, postAction, postAction, setControlledPanel, wasAdded, wasRemovedpublic void init(com.threerings.crowd.util.CrowdContext ctx,
com.threerings.crowd.data.PlaceConfig config)
super.init in such cases.init in class com.threerings.crowd.client.PlaceControllerctx - the client context.config - the configuration of the game we are intended to
control.public void willEnterPlace(com.threerings.crowd.data.PlaceObject plobj)
willEnterPlace in class com.threerings.crowd.client.PlaceControllerpublic void didLeavePlace(com.threerings.crowd.data.PlaceObject plobj)
didLeavePlace in class com.threerings.crowd.client.PlaceControllerpublic int getMatchType()
public boolean isGameOver()
public void setGameOver(boolean gameOver)
public void resetGame()
gameWillReset(), ends the current game (locally, it does not tell the server to
end the game), and waits to receive a reset notification (which is simply an event setting
the game state to IN_PLAY even though it's already set to IN_PLAY)
from the server which will start up a new game. Derived classes should override gameWillReset() to perform any game-specific animations.public int getSessionId()
public boolean handleAction(ActionEvent action)
super.handleAction for events they don't specifically handle.handleAction in class com.threerings.crowd.client.PlaceControllerpublic void systemMessage(String bundle, String msg)
public void attributeChanged(com.threerings.presents.dobj.AttributeChangedEvent event)
attributeChanged in interface com.threerings.presents.dobj.AttributeChangeListenerCopyright © 2015. All rights reserved.