|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.samskivert.swing.Controller
com.threerings.crowd.client.PlaceController
com.threerings.parlor.game.client.GameController
com.threerings.puzzle.client.PuzzleController
public abstract class PuzzleController
The puzzle game controller handles logical actions for a puzzle game.
| Nested Class Summary | |
|---|---|
static interface |
PuzzleController.ClearPender
Used by fireWhenActionCleared(com.threerings.puzzle.client.PuzzleController.ClearPender). |
| Nested classes/interfaces inherited from class com.threerings.crowd.client.PlaceController |
|---|
com.threerings.crowd.client.PlaceController.DelegateOp |
| Field Summary | |
|---|---|
static String |
TOGGLE_CHATTING
The action command to toggle chatting mode. |
| Fields inherited from class com.samskivert.swing.Controller |
|---|
DISPATCHER |
| Fields inherited from interface com.threerings.puzzle.data.PuzzleCodes |
|---|
DEBUG_PUZZLE, DEFAULT_DIFFICULTY, PUZZLE_MESSAGE_BUNDLE |
| Fields inherited from interface com.threerings.presents.data.InvocationCodes |
|---|
ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR |
| Constructor Summary | |
|---|---|
PuzzleController()
|
|
| Method Summary | |
|---|---|
void |
addProgressEvent(int event,
Board board)
Adds the given progress event and a snapshot of the supplied board state to the set of progress events and associated board states for later transmission to the server. |
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. |
Board |
getBoard()
Returns the board associated with the puzzle. |
int |
getEventCount()
Returns the number of progress events currently queued up for sending to the server with the next progress update. |
String |
getPauseString()
Get the (untranslated) string to display when the puzzle is paused. |
int |
getPlayerIndex()
Returns the player's index in the list of players for the game. |
boolean |
handleAction(ActionEvent action)
Handles basic game controller action events. |
boolean |
hasAction()
Returns true if the puzzle has action, false if the action is cleared or it is suspended. |
boolean |
isChatting()
Returns true if the puzzle has been defocused because the player is doing some chatting. |
void |
mayLeavePlace(com.threerings.crowd.data.PlaceObject plobj)
|
void |
sendProgressUpdate()
Sends the server a game progress update with the list of events, as well as board states if PuzzlePanel.isSyncingBoards() is true. |
void |
setBoard(Board board)
Called when a new board is set. |
void |
setChatting(boolean chatting)
Sets whether we're focusing on the chat window rather than the puzzle. |
void |
setGameOver(boolean gameOver)
Sets the client game over override. |
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. |
| Methods inherited from class com.threerings.parlor.game.client.GameController |
|---|
getMatchType, getSessionId, init, isGameOver, resetGame, systemMessage |
| Methods inherited from class com.threerings.crowd.client.PlaceController |
|---|
getPlaceConfig, getPlaceView |
| Methods inherited from class com.samskivert.swing.Controller |
|---|
actionPerformed, configureAction, createActionButton, handleAction, handleAction, handleAction, postAction, postAction, postAction, setControlledPanel, wasAdded, wasRemoved |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TOGGLE_CHATTING
| Constructor Detail |
|---|
public PuzzleController()
| Method Detail |
|---|
public Board getBoard()
public int getPlayerIndex()
public void setGameOver(boolean gameOver)
GameController
setGameOver in class GameControllerpublic boolean hasAction()
public void setChatting(boolean chatting)
public String getPauseString()
public boolean isChatting()
public void willEnterPlace(com.threerings.crowd.data.PlaceObject plobj)
GameController
willEnterPlace in class GameControllerpublic void mayLeavePlace(com.threerings.crowd.data.PlaceObject plobj)
mayLeavePlace in class com.threerings.crowd.client.PlaceControllerpublic void didLeavePlace(com.threerings.crowd.data.PlaceObject plobj)
GameController
didLeavePlace in class GameControllerpublic void attributeChanged(com.threerings.presents.dobj.AttributeChangedEvent event)
attributeChanged in interface com.threerings.presents.dobj.AttributeChangeListenerattributeChanged in class GameControllerpublic void setBoard(Board board)
public boolean handleAction(ActionEvent action)
GameControllersuper.handleAction for events they don't specifically handle.
handleAction in class GameControllerpublic int getEventCount()
public void addProgressEvent(int event,
Board board)
public void sendProgressUpdate()
PuzzlePanel.isSyncingBoards() is true.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||