|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.crowd.server.PlaceManagerDelegate
com.threerings.parlor.server.PlayManagerDelegate
com.threerings.parlor.game.server.GameManagerDelegate
com.threerings.puzzle.server.PuzzleManagerDelegate
com.threerings.puzzle.drop.server.DropManagerDelegate
public abstract class DropManagerDelegate
Provides the necessary support for a puzzle game that involves 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, groups of blocks can be "broken" and garbage can be sent to other players' boards as a result. This is implemented as a delegate so that the natural hierarchy need not be twisted to differentiate between puzzles that use piece dropping and those that don't. Because we have need to structure our hierarchy around things like whether a puzzle is a duty puzzle, this becomes necessary.
A puzzle game using these services will then need to extend this delegate, implementing the
necessary methods to customize it for the particulars of their game and then register it with
their game manager via PlaceManager.addDelegate(com.threerings.crowd.server.PlaceManagerDelegate).
It also keeps track of, for each player, board level information, and player game status. Miscellaneous utility routines are provided for checking things like whether the game is over, whether a player is still active in the game, and so forth.
Derived classes are likely to want to override getPieceDropLogic().
| Field Summary | |
|---|---|
protected int |
_bhei
The board dimensions in pieces. |
protected int |
_bwid
The board dimensions in pieces. |
protected DropBoard[] |
_dboards
The drop game board for each player. |
protected DropConfig |
_dconfig
The drop game config object. |
protected PieceDropper |
_dropper
The piece dropper used to drop pieces in the board if the puzzle chooses to make use of piece dropping functionality. |
protected boolean |
_usedrop
Whether the game is using drop block functionality. |
protected boolean |
_userise
Whether the game is using board rising functionality. |
protected static int |
MAX_UPDATE_LOOPS
Used to limit the maximum number of board update loops permitted before assuming something's gone horribly awry and aborting. |
| Fields inherited from class com.threerings.puzzle.server.PuzzleManagerDelegate |
|---|
_puzmgr |
| Fields inherited from class com.threerings.parlor.server.PlayManagerDelegate |
|---|
_gmgr |
| Fields inherited from class com.threerings.crowd.server.PlaceManagerDelegate |
|---|
_invmgr, _omgr, _plmgr |
| 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 |
| Fields inherited from interface com.threerings.puzzle.drop.data.DropCodes |
|---|
DROP_MESSAGE_BUNDLE, DROP_STREAM, RISE_STREAM |
| Constructor Summary | |
|---|---|
DropManagerDelegate(DropLogic logic)
Creates a drop manager delegate with a logic that it uses to determine how to manage the drop puzzle. |
|
DropManagerDelegate(PuzzleManager puzmgr,
DropLogic logic)
Deprecated. use DropManagerDelegate(DropLogic). |
|
| Method Summary | |
|---|---|
void |
didInit(PlaceConfig config)
|
void |
didStartup(PlaceObject plobj)
|
protected boolean |
dropPieces(DropBoard board)
Drops any pieces that need dropping on the given player's board and returns whether any pieces were dropped. |
void |
gameWillStart()
Called by the game manager when the game is about to start. |
protected PieceDropLogic |
getPieceDropLogic()
Returns the piece drop logic used to drop any pieces that need dropping in the board. |
protected PieceDropper |
getPieceDropper(PieceDropLogic logic)
Returns the piece dropper used to drop any pieces that need dropping in the board. |
protected void |
placedBlock(int pidx)
This method should be called by derived classes whenever the player successfully places a drop block. |
| Methods inherited from class com.threerings.parlor.game.server.GameManagerDelegate |
|---|
gameDidEnd, gameDidStart, gameWillEnd, gameWillReset, playerWasReplaced, setAI, tickAI |
| Methods inherited from class com.threerings.parlor.server.PlayManagerDelegate |
|---|
isAgent, isPlayer, verifyIsPlayer, verifyIsPlayerOrAgent, verifyWritePermission |
| Methods inherited from class com.threerings.crowd.server.PlaceManagerDelegate |
|---|
addDispatcher, addProvider, bodyEntered, bodyLeft, bodyUpdated, didShutdown, init, placeBecameEmpty, where |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DropBoard[] _dboards
protected DropConfig _dconfig
protected boolean _usedrop
protected boolean _userise
protected int _bwid
protected int _bhei
protected PieceDropper _dropper
protected static final int MAX_UPDATE_LOOPS
| Constructor Detail |
|---|
@Deprecated
public DropManagerDelegate(PuzzleManager puzmgr,
DropLogic logic)
DropManagerDelegate(DropLogic).
public DropManagerDelegate(DropLogic logic)
| Method Detail |
|---|
public void didInit(PlaceConfig config)
didInit in class PuzzleManagerDelegatepublic void didStartup(PlaceObject plobj)
didStartup in class PlaceManagerDelegatepublic void gameWillStart()
GameManagerDelegate
gameWillStart in class GameManagerDelegateprotected boolean dropPieces(DropBoard board)
protected PieceDropLogic getPieceDropLogic()
protected PieceDropper getPieceDropper(PieceDropLogic logic)
protected void placedBlock(int pidx)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||