ggz.client.core
Class Game

java.lang.Object
  extended by ggz.client.core.Game
All Implemented Interfaces:
ModTransactionHandler, java.util.EventListener

public class Game
extends java.lang.Object
implements ModTransactionHandler


Constructor Summary
Game(Server server, Module module)
           
 
Method Summary
 void abort_game()
          Called after we have left the table.
 void add_event_hook(GameEventListener listener)
           
 Module get_module()
           
 int get_room_id()
           
 int get_seat_num()
           
 int get_table_id()
           
 void handle_boot(java.lang.String name)
          Boot a player
 void handle_bot(int seat_num)
          Put a bot into an open seat.
 void handle_chat(ChatType type, java.lang.String recipient, java.lang.String chat)
          A chat originating from the game client.
 void handle_error(java.lang.Throwable exception)
          There was an error communicating with the game client.
 void handle_info(int seat_num)
          Information about one or more players.
 void handle_open(int seat_num)
          Replace a bot/reserved seat with an open one.
 void handle_sit(int seat_num)
          Sit down (stop spectatin; join a seat)
 void handle_stand()
          Stand up (leave your seat; become a spectator)
 void handle_state(ModState prev)
          This function is called by ggzmod when the game state is changed.
 boolean is_spectator()
           
 void launch()
           
 void remove_event_hook(GameEventListener l)
           
 void set_server_fd(java.net.Socket fd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Game

public Game(Server server,
            Module module)
Method Detail

add_event_hook

public void add_event_hook(GameEventListener listener)

remove_event_hook

public void remove_event_hook(GameEventListener l)

handle_state

public void handle_state(ModState prev)
                  throws java.io.IOException
This function is called by ggzmod when the game state is changed. Game state changes are all initiated by the game client through ggzmod. So if we get here we just have to update ggzcore and the ggz client based on what changes have already happened.

Specified by:
handle_state in interface ModTransactionHandler
Throws:
java.io.IOException

handle_error

public void handle_error(java.lang.Throwable exception)
Description copied from interface: ModTransactionHandler
There was an error communicating with the game client.

Specified by:
handle_error in interface ModTransactionHandler

handle_sit

public void handle_sit(int seat_num)
                throws java.io.IOException
Description copied from interface: ModTransactionHandler
Sit down (stop spectatin; join a seat)

Specified by:
handle_sit in interface ModTransactionHandler
Throws:
java.io.IOException

handle_stand

public void handle_stand()
                  throws java.io.IOException
Description copied from interface: ModTransactionHandler
Stand up (leave your seat; become a spectator)

Specified by:
handle_stand in interface ModTransactionHandler
Throws:
java.io.IOException

handle_boot

public void handle_boot(java.lang.String name)
                 throws java.io.IOException
Description copied from interface: ModTransactionHandler
Boot a player

Specified by:
handle_boot in interface ModTransactionHandler
Throws:
java.io.IOException

handle_open

public void handle_open(int seat_num)
                 throws java.io.IOException
Description copied from interface: ModTransactionHandler
Replace a bot/reserved seat with an open one.

Specified by:
handle_open in interface ModTransactionHandler
Throws:
java.io.IOException

handle_bot

public void handle_bot(int seat_num)
                throws java.io.IOException
Description copied from interface: ModTransactionHandler
Put a bot into an open seat.

Specified by:
handle_bot in interface ModTransactionHandler
Throws:
java.io.IOException

handle_chat

public void handle_chat(ChatType type,
                        java.lang.String recipient,
                        java.lang.String chat)
                 throws java.io.IOException
Description copied from interface: ModTransactionHandler
A chat originating from the game client.

Specified by:
handle_chat in interface ModTransactionHandler
Throws:
java.io.IOException

handle_info

public void handle_info(int seat_num)
                 throws java.io.IOException
Description copied from interface: ModTransactionHandler
Information about one or more players.

Specified by:
handle_info in interface ModTransactionHandler
Throws:
java.io.IOException

is_spectator

public boolean is_spectator()

get_seat_num

public int get_seat_num()

get_room_id

public int get_room_id()

get_table_id

public int get_table_id()

abort_game

public void abort_game()
Called after we have left the table.


set_server_fd

public void set_server_fd(java.net.Socket fd)

get_module

public Module get_module()

launch

public void launch()