|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.crowd.client.PlaceControllerDelegate
com.threerings.parlor.game.client.GameControllerDelegate
com.threerings.puzzle.client.PuzzleControllerDelegate
com.threerings.puzzle.drop.client.DropControllerDelegate
public abstract class DropControllerDelegate
Games that wish to make use of the drop puzzle services will need to create an extension of
this delegate class, customizing it for their particular game and then adding it via
PlaceController.addDelegate(com.threerings.crowd.client.PlaceControllerDelegate).
It handles logical actions for a puzzle game that generally consists of a two-dimensional board containing pieces, with new pieces either falling into the board as a "drop block", or rising into the bottom of the board in new piece rows.
Derived classes must implement getPieceVelocity(boolean) and evolveBoard().
Block-dropping puzzles will likely want to override createNextBlock(),
blockDidLand(), and getPieceDropLogic().
Board-rising puzzles will likely want to override getRiseVelocity(),
getRiseDistance(), getPieceDropLogic(), and boardDidRise().
| Field Summary | |
|---|---|
static String |
END_DROP_BLOCK
The action command for ending dropping the block. |
static String |
MOVE_BLOCK_LEFT
The action command for moving the block to the left. |
static String |
MOVE_BLOCK_RIGHT
The action command for moving the block to the right. |
static String |
RAISE_ROW
The action command for raising the next rising row. |
static String |
ROTATE_BLOCK_CCW
The action command for rotating the block counter-clockwise. |
static String |
ROTATE_BLOCK_CW
The action command for rotating the block clockwise. |
static String |
START_DROP_BLOCK
The action command for starting to dropping the block. |
| Fields inherited from interface com.threerings.puzzle.drop.data.DropCodes |
|---|
DROP_MESSAGE_BUNDLE, DROP_STREAM, RISE_STREAM |
| Fields inherited from interface com.threerings.puzzle.drop.data.DropPieceCodes |
|---|
DROP_BLOCK_PIECE_COUNT, PIECE_NONE |
| Fields inherited from interface com.threerings.util.DirectionCodes |
|---|
CARDINAL_DIRECTIONS, CCW, CW, DIRECTION_COUNT, DOWN, EAST, EASTNORTHEAST, EASTSOUTHEAST, FINE_DIRECTION_COUNT, HORIZONTAL, LEFT, NONE, NORTH, NORTHEAST, NORTHNORTHEAST, NORTHNORTHWEST, NORTHWEST, RIGHT, SOUTH, SOUTHEAST, SOUTHSOUTHEAST, SOUTHSOUTHWEST, SOUTHWEST, UP, VERTICAL, WEST, WESTNORTHWEST, WESTSOUTHWEST |
| 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 | |
|---|---|
DropControllerDelegate(PuzzleController ctrl,
DropLogic logic)
Creates a delegate with the specified drop game logic and controller. |
|
| Method Summary | |
|---|---|
void |
gameDidEnd()
Called when the game transitions to the GAME_OVER
state. |
Component |
getComponent()
|
boolean |
handleAction(ActionEvent action)
|
void |
init(com.threerings.crowd.util.CrowdContext ctx,
com.threerings.crowd.data.PlaceConfig config)
|
boolean |
needsPaint()
|
void |
setBoard(Board board)
Called when the puzzle controller sets up a new board for the player. |
void |
setRisingPaused(boolean paused)
Sets whether the board rising is paused. |
void |
tick(long tickStamp)
|
void |
updateSelfSummary()
Updates the player's own local board summary to reflect the local copy of the player's board which is likely to be more up to date than the server-side board from which all other player board summaries originate. |
void |
zipToNextRow()
Causes the board to zip quickly to the next row. |
| Methods inherited from class com.threerings.puzzle.client.PuzzleControllerDelegate |
|---|
didLeavePlace, playerKnockedOut, setChatting, willEnterPlace |
| Methods inherited from class com.threerings.parlor.game.client.GameControllerDelegate |
|---|
gameDidStart, gameWasCancelled, gameWillReset |
| Methods inherited from class com.threerings.crowd.client.PlaceControllerDelegate |
|---|
mayLeavePlace |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String MOVE_BLOCK_LEFT
public static final String MOVE_BLOCK_RIGHT
public static final String ROTATE_BLOCK_CCW
public static final String ROTATE_BLOCK_CW
public static final String START_DROP_BLOCK
public static final String END_DROP_BLOCK
public static final String RAISE_ROW
| Constructor Detail |
|---|
public DropControllerDelegate(PuzzleController ctrl,
DropLogic logic)
| Method Detail |
|---|
public void init(com.threerings.crowd.util.CrowdContext ctx,
com.threerings.crowd.data.PlaceConfig config)
init in class com.threerings.crowd.client.PlaceControllerDelegatepublic void gameDidEnd()
GameControllerDelegateGAME_OVER
state. This happens when the game reaches some end condition by
normal means (is not cancelled or aborted).
gameDidEnd in class GameControllerDelegatepublic boolean handleAction(ActionEvent action)
handleAction in class com.threerings.crowd.client.PlaceControllerDelegatepublic void setBoard(Board board)
PuzzleControllerDelegate
setBoard in class PuzzleControllerDelegateboard - the newly initialized and ready-to-go board.public void updateSelfSummary()
public void tick(long tickStamp)
tick in interface com.threerings.media.FrameParticipantpublic Component getComponent()
getComponent in interface com.threerings.media.FrameParticipantpublic boolean needsPaint()
needsPaint in interface com.threerings.media.FrameParticipantpublic void setRisingPaused(boolean paused)
public void zipToNextRow()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||