ggz.cards.client
Interface CardGameHandler

All Known Implementing Classes:
CardGamePanel

public interface CardGameHandler


Method Summary
 void alert_badplay(java.lang.String err_msg)
           
 void alert_bid(int bidder, Bid bid)
           
 void alert_hand_size(int max_hand_size)
           
 void alert_newgame(CardSetType cardset_type)
           
 void alert_newhand()
           
 void alert_num_players(int numplayers, int old_numplayers)
           
 void alert_play(int player, Card card)
           
 void alert_player(int i, SeatType old_type, java.lang.String old_name)
           
 void alert_players_status()
          Called when the status of one or more players has changed.
 void alert_scores(int hand_num)
          Called when each team's score is received from the server.
 void alert_server(java.net.Socket fd)
           
 void alert_state(Client.GameState oldState, Client.GameState newState)
           
 void alert_table()
          A table message tells you all the cards on the table.
 void alert_trick(int winner)
          A trick message tells you about the end of a trick (and who won).
 void alert_tricks_count()
          Called when the number of tricks that a player has won is received from the server.
 void alert_trump()
          Called when the trump suit is known for the current hand.
 void display_hand(int player)
           
 void get_bid(Bid[] bid_choices, java.lang.String[] bid_texts, java.lang.String[] bid_descs)
           
 void get_newgame()
          Server has requested the client to OK a new game.
 boolean get_options(java.lang.String[] types, java.lang.String[] descs, int[] defaults, java.lang.String[][] option_choices)
          An options request asks you to pick a set of options.
 void get_play(int play_hand, Card[] valid_cards)
           
 void handle_disconnect()
          Called when the socket disconnects.
 void handle_game_message(GGZCardInputStream in, java.lang.String gametype)
          Called when game-specific data is received by the client.
 void handle_gameover(Player[] winners)
           
 void set_cardlist_message(java.lang.String mark, Card[][] cardlist)
          Called when either "Last Trick" or "Previous Hand" message is received from the server.
 void set_player_message(int player, java.lang.String message)
           
 void set_text_message(java.lang.String mark, java.lang.String message)
           
 

Method Detail

alert_server

void alert_server(java.net.Socket fd)

set_text_message

void set_text_message(java.lang.String mark,
                      java.lang.String message)

set_cardlist_message

void set_cardlist_message(java.lang.String mark,
                          Card[][] cardlist)
Called when either "Last Trick" or "Previous Hand" message is received from the server.

Parameters:
mark - One of either "Last Trick" or "Previous Hand".
cardlist - Cards in the last trick or hand. The first index is the player index, the second the card.

set_player_message

void set_player_message(int player,
                        java.lang.String message)

handle_game_message

void handle_game_message(GGZCardInputStream in,
                         java.lang.String gametype)
                         throws java.io.IOException
Called when game-specific data is received by the client. The client will skip over any remaining bytes that were not read by the handler.

Parameters:
in -
gametype -
Throws:
java.io.IOException

alert_newgame

void alert_newgame(CardSetType cardset_type)

handle_gameover

void handle_gameover(Player[] winners)

alert_player

void alert_player(int i,
                  SeatType old_type,
                  java.lang.String old_name)

alert_num_players

void alert_num_players(int numplayers,
                       int old_numplayers)

alert_hand_size

void alert_hand_size(int max_hand_size)

display_hand

void display_hand(int player)

get_bid

void get_bid(Bid[] bid_choices,
             java.lang.String[] bid_texts,
             java.lang.String[] bid_descs)

alert_bid

void alert_bid(int bidder,
               Bid bid)

get_play

void get_play(int play_hand,
              Card[] valid_cards)

alert_badplay

void alert_badplay(java.lang.String err_msg)

alert_play

void alert_play(int player,
                Card card)

alert_table

void alert_table()
A table message tells you all the cards on the table. Each player only gets one card.


alert_trick

void alert_trick(int winner)
A trick message tells you about the end of a trick (and who won).


get_options

boolean get_options(java.lang.String[] types,
                    java.lang.String[] descs,
                    int[] defaults,
                    java.lang.String[][] option_choices)
                    throws java.io.IOException
An options request asks you to pick a set of options. Each "option" gives a list of choices so that you pick one choice for each option. An option with only one choice is a special case: a boolean option.

Throws:
java.io.IOException

get_newgame

void get_newgame()
Server has requested the client to OK a new game. This is sent at the start of a new game before the game begins.


alert_newhand

void alert_newhand()

alert_trump

void alert_trump()
Called when the trump suit is known for the current hand.


alert_scores

void alert_scores(int hand_num)
Called when each team's score is received from the server.


alert_tricks_count

void alert_tricks_count()
Called when the number of tricks that a player has won is received from the server.


handle_disconnect

void handle_disconnect()
Called when the socket disconnects.


alert_state

void alert_state(Client.GameState oldState,
                 Client.GameState newState)

alert_players_status

void alert_players_status()
Called when the status of one or more players has changed. The Players bidding and playing property will be true for each player that is either playing or bidding respectively.