public abstract class DropControllerDelegate extends PuzzleControllerDelegate implements DropCodes, DropPieceCodes, com.threerings.media.FrameParticipant
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().
| Modifier and Type | Field and Description |
|---|---|
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.
|
DROP_MESSAGE_BUNDLE, DROP_STREAM, RISE_STREAMDROP_BLOCK_PIECE_COUNT, PIECE_NONECARDINAL_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, WESTSOUTHWESTDEBUG_PUZZLE, DEFAULT_DIFFICULTY, PUZZLE_MESSAGE_BUNDLE| Constructor and Description |
|---|
DropControllerDelegate(PuzzleController ctrl,
DropLogic logic)
Creates a delegate with the specified drop game logic and controller.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
didLeavePlace, playerKnockedOut, setChatting, willEnterPlacegameDidStart, gameWasCancelled, gameWillResetpublic 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
public DropControllerDelegate(PuzzleController ctrl, DropLogic logic)
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)
PuzzleControllerDelegatesetBoard 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()
Copyright © 2015. All rights reserved.