public class CardGameManager extends GameManager implements TurnGameManager, CardCodes
ACE, BLACK_JOKER, CLUBS, DIAMONDS, HEARTS, JACK, KING, QUEEN, RED_JOKER, SPADESACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERRORALREADY_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_OCCUPIEDGAME_CHAT_TYPE, GAME_MESSAGE_BUNDLE, PLAYER_KNOCKED_OUT, WINNERS_AND_LOSERS| Constructor and Description |
|---|
CardGameManager() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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, systemMessageaddDelegate, applyToDelegates, applyToOccupants, bodyWillEnter, bodyWillLeave, checkPermissions, getConfig, getLocation, getPlaceObject, init, isValidSpeaker, messageReceived, ratifyBodyEntry, registerMessageHandler, shutdown, startup, toString, updateOccupantInfo, whereequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPlayerCount, getPlayerIndex, getPlayerName, isActivePlayerpublic void turnWillStart()
TurnGameManagerturnWillStart in interface TurnGameManagerpublic void turnDidStart()
TurnGameManagerturnDidStart in interface TurnGameManagerpublic void turnDidEnd()
TurnGameManagerturnDidEnd 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 playerpublic Hand[] dealHands(Deck deck, int size)
deck - the deck from which to dealsize - the size of the hands to dealpublic 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 exchangedpublic 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 transferCopyright © 2015. All rights reserved.