dd.net
Class ObserverClient

java.lang.Object
  extended bydd.net.NetClient
      extended bydd.net.TurnClient
          extended bydd.net.ObserverClient
All Implemented Interfaces:
Chat, Client, java.lang.Runnable

public class ObserverClient
extends TurnClient

This is a turn client that is incapable of taking game actions, suitable for instructors and other lurkers.

Author:
Seth McGinnis

Field Summary
 
Fields inherited from class dd.net.TurnClient
myPlayerID
 
Fields inherited from class dd.net.NetClient
ALIVE_PERIOD, DEFAULT_SERVER, DISCOVERY_URL, uiClient
 
Constructor Summary
ObserverClient(UI ui, java.lang.String serverName)
           
 
Method Summary
 void amend(Proposal prop)
           
 void callForVote(java.lang.String proposalID)
           
 void createNewGame(java.lang.String gameName)
           
 void endBriefing()
           
 void joinGame(java.lang.String playerName, int playerRequest)
           
 void randomProposal()
           
 void sendChatMessage(java.lang.String user, java.lang.String message)
          This overrides the Chat interface in NetClient to include role information in the chat message.
 void vote(int vote)
           
 void votingTimerExpired()
           
 void withdraw(java.lang.String proposalID)
           
 
Methods inherited from class dd.net.TurnClient
gameListDirty, getGameList, getRoot, joinGame, joinGame, listGames, opinion, rejoinGame, setupDefaultActions
 
Methods inherited from class dd.net.NetClient
addHandler, discoverVenues, getClientName, getReader, gotChatMessage, handleMessage, isRunning, main, run, sendMessage, setChatClient, setClientName, setGame, setUI, startRunning, stopRunning, waitUntilReady
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObserverClient

public ObserverClient(UI ui,
                      java.lang.String serverName)
               throws java.lang.Exception
Method Detail

endBriefing

public void endBriefing()
Overrides:
endBriefing in class TurnClient

randomProposal

public void randomProposal()
Overrides:
randomProposal in class TurnClient

joinGame

public void joinGame(java.lang.String playerName,
                     int playerRequest)
Overrides:
joinGame in class TurnClient

createNewGame

public void createNewGame(java.lang.String gameName)
Overrides:
createNewGame in class TurnClient

withdraw

public void withdraw(java.lang.String proposalID)
Overrides:
withdraw in class TurnClient

amend

public void amend(Proposal prop)
Overrides:
amend in class TurnClient

callForVote

public void callForVote(java.lang.String proposalID)
Overrides:
callForVote in class TurnClient

vote

public void vote(int vote)
Overrides:
vote in class TurnClient

votingTimerExpired

public void votingTimerExpired()
Overrides:
votingTimerExpired in class TurnClient

sendChatMessage

public void sendChatMessage(java.lang.String user,
                            java.lang.String message)
Description copied from class: TurnClient
This overrides the Chat interface in NetClient to include role information in the chat message. NetClient implements this method when the user sends a chat message. Chat messages in DLUG should include role information as part of the chat. This overrieds that behavior by appending the role information to the user name.

Specified by:
sendChatMessage in interface Chat
Overrides:
sendChatMessage in class TurnClient
Parameters:
user - user sending the chat message
message - the chat message that needs to be sent