public class Client
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Client.GameState
GGZCards client game states
|
static class |
Client.TrickInfo |
| Modifier and Type | Field and Description |
|---|---|
protected int |
dealer |
protected java.net.Socket |
fd |
protected CardGameHandler |
game |
protected boolean |
isNewTrick |
protected Client.TrickInfo |
lastTrick
Structure that contains cards in the trick for each player.
|
protected java.lang.String |
options |
protected int |
playerWhoLedLastTrick |
protected Card[][] |
previousHand
Represents the previous hand for each players.
|
protected java.lang.String |
scores |
static Client.GameState |
STATE_BID
our turn to bid
|
static Client.GameState |
STATE_DEAL
dealing
|
static Client.GameState |
STATE_DONE
game's over
|
static Client.GameState |
STATE_INIT
game hasn't started yet
|
static Client.GameState |
STATE_OPTIONS
determining options
|
static Client.GameState |
STATE_PLAY
our turn to play
|
static Client.GameState |
STATE_WAIT
waiting for others
|
protected Suit |
trump_suit |
| Constructor and Description |
|---|
Client() |
| Modifier and Type | Method and Description |
|---|---|
void |
add_listener(CardGameHandler l) |
int |
get_dealer() |
Client.GameState |
get_game_state() |
java.lang.String |
get_game_type() |
Client.TrickInfo |
get_last_trick() |
Player |
get_nth_player(int n) |
Team |
get_nth_team(int n) |
int |
get_num_players() |
int |
get_num_real_players() |
int |
get_num_teams() |
java.lang.String |
get_options() |
Card[][] |
get_previous_hand() |
java.lang.String |
get_scores() |
void |
handle_server_connect(java.net.Socket server_fd) |
protected void |
handle_server_input() |
boolean |
hasTeams() |
void |
send_bid(int bid) |
void |
send_newgame() |
void |
send_options(int[] option_indexes) |
void |
send_play(Card card) |
protected java.net.Socket fd
protected Client.TrickInfo lastTrick
protected Card[][] previousHand
protected int playerWhoLedLastTrick
protected boolean isNewTrick
protected Suit trump_suit
protected int dealer
protected java.lang.String scores
protected java.lang.String options
protected CardGameHandler game
public static final Client.GameState STATE_INIT
public static final Client.GameState STATE_WAIT
public static final Client.GameState STATE_DEAL
public static final Client.GameState STATE_PLAY
public static final Client.GameState STATE_BID
public static final Client.GameState STATE_DONE
public static final Client.GameState STATE_OPTIONS
public int get_num_players()
public Player get_nth_player(int n)
public int get_num_real_players()
public int get_num_teams()
public Team get_nth_team(int n)
public boolean hasTeams()
public void add_listener(CardGameHandler l)
public Client.GameState get_game_state()
public java.lang.String get_game_type()
public Client.TrickInfo get_last_trick()
public Card[][] get_previous_hand()
public java.lang.String get_scores()
public java.lang.String get_options()
public int get_dealer()
public void send_newgame()
throws java.io.IOException
java.io.IOExceptionpublic void send_bid(int bid)
throws java.io.IOException
java.io.IOExceptionpublic void send_options(int[] option_indexes)
throws java.io.IOException
java.io.IOExceptionpublic void send_play(Card card) throws java.io.IOException
java.io.IOExceptionprotected void handle_server_input()
throws java.io.IOException
java.io.IOExceptionpublic void handle_server_connect(java.net.Socket server_fd)
throws java.io.IOException
java.io.IOException