com.threerings.parlor.card.client
Class CardGameController
java.lang.Object
com.samskivert.swing.Controller
com.threerings.crowd.client.PlaceController
com.threerings.parlor.game.client.GameController
com.threerings.parlor.card.client.CardGameController
- All Implemented Interfaces:
- CardGameReceiver, CardCodes, TurnGameController, InvocationReceiver, InvocationCodes, AttributeChangeListener, ChangeListener, ActionListener, EventListener
public abstract class CardGameController
- extends GameController
- implements TurnGameController, CardCodes, CardGameReceiver
A controller class for card games. Handles common functions like accepting dealt hands.
|
Method Summary |
void |
cardsTransferredBetweenPlayers(int fromidx,
int toidx,
int cards)
Dispatched to the client when a set of cards is transferred between two other players in
the game. |
void |
didLeavePlace(PlaceObject plobj)
Removes our listener registration from the game object and cleans house. |
void |
receivedCardsFromPlayer(int plidx,
Card[] cards)
Dispatched to the client when it has received a set of cards from another player. |
void |
receivedHand(Hand hand)
Called when the server deals the client a new hand of cards. |
void |
receivedHand(int oid,
Hand hand)
Called by our sender to notify us of a received hand. |
void |
sentCardsToPlayer(int plidx,
Card[] cards)
Dispatched to the client when the server has forced it to send a set of cards to another
player. |
void |
turnDidChange(Name turnHolder)
Called when the turn changed. |
void |
willEnterPlace(PlaceObject plobj)
Adds this controller as a listener to the game object (thus derived classes need not do so)
and lets the game manager know that we are now ready to go. |
| Methods inherited from class com.threerings.parlor.game.client.GameController |
attributeChanged, gameDidEnd, gameDidStart, gameWasCancelled, gameWillReset, getMatchType, getSessionId, handleAction, init, isGameOver, playerReady, resetGame, setGameOver, stateDidChange, systemMessage |
| Methods inherited from class com.samskivert.swing.Controller |
actionPerformed, configureAction, createActionButton, generateArguments, handleAction, handleAction, handleAction, postAction, postAction, postAction, setControlledPanel, wasAdded, wasRemoved |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CardGameController
public CardGameController()
willEnterPlace
public void willEnterPlace(PlaceObject plobj)
- Description copied from class:
GameController
- Adds this controller as a listener to the game object (thus derived classes need not do so)
and lets the game manager know that we are now ready to go.
- Overrides:
willEnterPlace in class GameController
didLeavePlace
public void didLeavePlace(PlaceObject plobj)
- Description copied from class:
GameController
- Removes our listener registration from the game object and cleans house.
- Overrides:
didLeavePlace in class GameController
turnDidChange
public void turnDidChange(Name turnHolder)
- Description copied from interface:
TurnGameController
- Called when the turn changed. This indicates the start of a turn
and the user interface should adjust itself accordingly (activating
controls if it is our turn and deactivating them if it is not).
- Specified by:
turnDidChange in interface TurnGameController
- Parameters:
turnHolder - the username of the new holder of the turn.
receivedHand
public final void receivedHand(int oid,
Hand hand)
- Called by our sender to notify us of a received hand.
- Specified by:
receivedHand in interface CardGameReceiver
- Parameters:
oid - the oid of the game for which this hand applieshand - the received hand
receivedHand
public void receivedHand(Hand hand)
- Called when the server deals the client a new hand of cards. Default implementation does
nothing.
- Parameters:
hand - the hand dealt to the user
receivedCardsFromPlayer
public void receivedCardsFromPlayer(int plidx,
Card[] cards)
- Dispatched to the client when it has received a set of cards from another player. Default
implementation does nothing.
- Specified by:
receivedCardsFromPlayer in interface CardGameReceiver
- Parameters:
plidx - the index of the player providing the cardscards - the cards received
sentCardsToPlayer
public void sentCardsToPlayer(int plidx,
Card[] cards)
- Dispatched to the client when the server has forced it to send a set of cards to another
player. Default implementation does nothing.
- Specified by:
sentCardsToPlayer in interface CardGameReceiver
- Parameters:
plidx - the index of the player to which the cards were sentcards - the cards sent
cardsTransferredBetweenPlayers
public void cardsTransferredBetweenPlayers(int fromidx,
int toidx,
int cards)
- Dispatched to the client when a set of cards is transferred between two other players in
the game. Default implementation does nothing.
- Specified by:
cardsTransferredBetweenPlayers in interface CardGameReceiver
- Parameters:
fromidx - the index of the player sending the cardstoidx - the index of the player receiving the cardscards - the number of cards transferred