de.kosi.model.game
Class ProxyGameListener

java.lang.Object
  |
  +--de.kosi.model.game.ProxyGameListener
All Implemented Interfaces:
java.util.EventListener, GameListener, java.rmi.Remote

public class ProxyGameListener
extends java.lang.Object
implements GameListener

The proxy listener for the game listener interface.

ChangeLog:

 
 $Log: ProxyGameListener.java,v $
 Revision 1.7  2001/08/30 10:44:38  jiriki
 Finished implementation of claim

 Revision 1.6  2001/08/28 12:35:23  jiriki
 Started Implementation of claim

 Revision 1.5  2001/08/23 11:11:36  madmanmoon
 Client-side implementation of claims complete.

 Revision 1.4  2001/07/13 10:49:06  jiriki
 Started fix for Bugs 440155 and 440333.

 Revision 1.3  2001/06/01 13:22:58  jiriki
 GameView working again.

 Revision 1.2  2001/05/30 10:25:51  jiriki
 Refactored Client.

 Revision 1.1.1.1  2001/04/29 18:05:18  jiriki
 Imported sources from zola.

 Revision 1.3  2001/04/17 19:30:08  wombat
 Updated Documentation

 Revision 1.2  2001/04/08 14:30:45  wombat
 Anfang Implementierung der selbst-alertierung

 Revision 1.1  2001/03/07 13:22:52  login
 added the mighty proxy game listener


 

Version:
$Revision: 1.7 $ ($Date: 2001/08/30 10:44:38 $)
Author:
Niklas, Ole, Timo

Constructor Summary
ProxyGameListener(GameListener listener)
          Creates a new proxy game listener for the given game listener.
 
Method Summary
 void handleActivePlayer(int direction, int trickSuit, int number)
          Invoked when a player becomes active during card play.
 void handleActivePlayer(int direction, SuitBid highestBid, boolean doublePossible, boolean redoublePossible)
          Invoked when a player becomes active during bidding.
 void handleBid(Bid bid, Alert alert, int number)
          Invoked when a bid has been placed.
 void handleCard(Card card, int direction, int number)
          Invoked when a card is played.
 void handleClaim(int tricks, java.util.Collection cards)
          Invoked when a player claims the remaining tricks.
 void handleClaimResult(boolean accepted)
          Invoked to inform the players of the result of a claim.
 void handleDummyDown(java.util.Collection cards, int direction)
          Invoked when the dummy cards are published to all players.
 void handleStateChanged(int status)
          Invoked when the game's state changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyGameListener

public ProxyGameListener(GameListener listener)
Creates a new proxy game listener for the given game listener.
Parameters:
listener - The game listener this proxy forwards all recevied events to.
Method Detail

handleActivePlayer

public void handleActivePlayer(int direction,
                               SuitBid highestBid,
                               boolean doublePossible,
                               boolean redoublePossible)
                        throws java.rmi.RemoteException
Invoked when a player becomes active during bidding.
Specified by:
handleActivePlayer in interface GameListener
Parameters:
direction - Direction of the player beeing activated.
highestBid - Highest bid placed until now.
doublePossible - Wether a double is possible.
redoublePossible - Wether a redouble is possible.

handleActivePlayer

public void handleActivePlayer(int direction,
                               int trickSuit,
                               int number)
                        throws java.rmi.RemoteException
Invoked when a player becomes active during card play.
Specified by:
handleActivePlayer in interface GameListener
Parameters:
direction - Direction of the player beeing activated.
trickSuit - The suit of the current trick, or -1 if not available.

handleBid

public void handleBid(Bid bid,
                      Alert alert,
                      int number)
               throws java.rmi.RemoteException
Invoked when a bid has been placed.
Specified by:
handleBid in interface GameListener
Parameters:
bid - Bid that has been placed.
alert - Alert if this bid was alerted, null otherwise.
number - Number of the Bid
Throws:
java.rmi.RemoteException - if the remote call fails.

handleCard

public void handleCard(Card card,
                       int direction,
                       int number)
                throws java.rmi.RemoteException
Invoked when a card is played.
Specified by:
handleCard in interface GameListener
Parameters:
card - Card that is played.
number - Number of the card. (the n-th card beeing played, 0 .. 51)
Throws:
java.rmi.RemoteException - if the remote call fails.

handleDummyDown

public void handleDummyDown(java.util.Collection cards,
                            int direction)
                     throws java.rmi.RemoteException
Invoked when the dummy cards are published to all players.
Specified by:
handleDummyDown in interface GameListener
Parameters:
cards - Collection containing the cards of the dummy.
direction - Direction of the dummy.
Throws:
java.rmi.RemoteException - if the remote call fails.

handleClaim

public void handleClaim(int tricks,
                        java.util.Collection cards)
                 throws java.rmi.RemoteException
Invoked when a player claims the remaining tricks.
Specified by:
handleClaim in interface GameListener
Parameters:
tricks - the number of tricks being claimed.
cards - the cards of the player who claims.
Throws:
java.rmi.RemoteException - if the remote call fails.

handleClaimResult

public void handleClaimResult(boolean accepted)
                       throws java.rmi.RemoteException
Invoked to inform the players of the result of a claim.
Specified by:
handleClaimResult in interface GameListener
Parameters:
accepted - wether the claim has been accepted.
Throws:
java.rmi.RemoteException - if the remote call fails.

handleStateChanged

public void handleStateChanged(int status)
                        throws java.rmi.RemoteException
Invoked when the game's state changed.
Specified by:
handleStateChanged in interface GameListener
Parameters:
status - New status (PLAYING, FINISHED)
Throws:
java.rmi.RemoteException - If the remote call fails.