|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.crowd.server.PlaceManager
com.threerings.parlor.game.server.GameManager
com.threerings.parlor.card.server.CardGameManager
public class CardGameManager
A manager class for card games. Handles common functions like dealing hands of cards to all players.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.crowd.server.PlaceManager |
|---|
com.threerings.crowd.server.PlaceManager.DelegateOp, com.threerings.crowd.server.PlaceManager.MessageHandler |
| Field Summary |
|---|
| Fields inherited from interface com.threerings.parlor.card.data.CardCodes |
|---|
ACE, BLACK_JOKER, CLUBS, DIAMONDS, HEARTS, JACK, KING, QUEEN, RED_JOKER, SPADES |
| 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.parlor.data.ParlorCodes |
|---|
ALREADY_AT_TABLE, BANNED_FROM_TABLE, GAME_ALREADY_STARTED, INVALID_TABLE_POSITION, INVITATION_ACCEPTED, INVITATION_COUNTERED, INVITATION_REFUSED, INVITEE_NOT_ONLINE, MUST_BE_CREATOR, NO_SELF_BOOT, NO_SUCH_TABLE, NOT_AT_TABLE, PARLOR_GROUP, TABLE_POSITION_OCCUPIED |
| Fields inherited from interface com.threerings.parlor.game.data.GameCodes |
|---|
GAME_CHAT_TYPE, GAME_MESSAGE_BUNDLE, PLAYER_KNOCKED_OUT, WINNERS_AND_LOSERS |
| Constructor Summary | |
|---|---|
CardGameManager()
|
|
| Method Summary | |
|---|---|
Hand |
dealHand(Deck deck,
int size,
int playerIndex)
Deals a hand of cards to the player at the specified index from the given Deck. |
Hand[] |
dealHands(Deck deck,
int size)
Deals a hand of cards to each player from the specified Deck. |
com.threerings.presents.data.ClientObject |
getClientObject(int pidx)
Returns the client object corresponding to the specified player index, or null if the position is not occupied by a player. |
int |
getPlayerIndex(com.threerings.presents.data.ClientObject client)
Gets the player index of the specified client object, or -1 if the client object does not represent a player. |
void |
rematchGame()
This should be called to start a rematched game. |
void |
transferCardsBetweenPlayers(int[] toPlayerIndices,
Card[][] cards)
Sends sets of cards between players simultaneously. |
void |
transferCardsBetweenPlayers(int fromPlayerIdx,
int toPlayerIdx,
Card[] cards)
Sends a set of cards from one player to another. |
void |
turnDidEnd()
Called when the turn was ended. |
void |
turnDidStart()
Called when we have started the next turn. |
void |
turnWillStart()
Called when we are about to start the next turn. |
| Methods inherited from class com.threerings.parlor.game.server.GameManager |
|---|
addPlayer, addPlayerAt, allPlayersReady, cancelGame, checkWritePermission, endGame, endPlayerGame, getGameConfig, getGameId, getMatchType, getPlayer, getPlayerCount, getPlayerDisplayName, getPlayerIndex, getPlayerName, getPlayerOid, getPlayerPersistentId, getPlayerPersistentId, getPlayerSlots, getPresentPlayerIndex, getSessionId, isActivePlayer, isAgent, isAI, isPlayer, occupantInRoom, playerIsReady, playerReady, removePlayer, replacePlayer, resetGame, setAI, shouldConcludeGame, startGame, systemMessage, systemMessage |
| Methods inherited from class com.threerings.crowd.server.PlaceManager |
|---|
addDelegate, applyToDelegates, applyToOccupants, bodyWillEnter, bodyWillLeave, checkPermissions, getConfig, getLocation, getPlaceObject, init, isValidSpeaker, messageReceived, ratifyBodyEntry, registerMessageHandler, shutdown, startup, toString, updateOccupantInfo, where |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.threerings.parlor.turn.server.TurnGameManager |
|---|
getPlayerCount, getPlayerIndex, getPlayerName, isActivePlayer |
| Constructor Detail |
|---|
public CardGameManager()
| Method Detail |
|---|
public void turnWillStart()
TurnGameManager
turnWillStart in interface TurnGameManagerpublic void turnDidStart()
TurnGameManager
turnDidStart in interface TurnGameManagerpublic void turnDidEnd()
TurnGameManager
turnDidEnd in interface TurnGameManagerpublic void rematchGame()
public Hand dealHand(Deck deck,
int size,
int playerIndex)
deck - the deck from which to dealsize - the size of the hand to dealplayerIndex - the index of the target player
public Hand[] dealHands(Deck deck,
int size)
deck - the deck from which to dealsize - the size of the hands to deal
public int getPlayerIndex(com.threerings.presents.data.ClientObject client)
public com.threerings.presents.data.ClientObject getClientObject(int pidx)
public void transferCardsBetweenPlayers(int fromPlayerIdx,
int toPlayerIdx,
Card[] cards)
fromPlayerIdx - the index of the player sending the cardstoPlayerIdx - the index of the player receiving the cardscards - the cards to be exchanged
public void transferCardsBetweenPlayers(int[] toPlayerIndices,
Card[][] cards)
toPlayerIndices - for each player, the index of the player to transfer cards tocards - for each player, the cards to transfer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||