dd.net
Class TurnClient
java.lang.Object
dd.net.NetClient
dd.net.TurnClient
- All Implemented Interfaces:
- Chat, Client, java.lang.Runnable
- Direct Known Subclasses:
- ObserverClient
- public class TurnClient
- extends NetClient
This is the turn client for DLUG. It handles all of the local
(client) logic for player actions during a turn. It's also the
message handler, and mediates between the UI and the networking.
- Author:
- Seth McGinnis
Field Summary |
protected java.lang.String |
myPlayerID
|
Constructor Summary |
TurnClient(UI ui,
java.lang.String serverName)
|
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 |
myPlayerID
protected java.lang.String myPlayerID
TurnClient
public TurnClient(UI ui,
java.lang.String serverName)
throws java.lang.Exception
getRoot
public GameRoot getRoot()
setupDefaultActions
public void setupDefaultActions()
- Overrides:
setupDefaultActions
in class NetClient
getGameList
public java.lang.String[] getGameList()
endBriefing
public void endBriefing()
randomProposal
public void randomProposal()
gameListDirty
public boolean gameListDirty()
listGames
public void listGames()
joinGame
public void joinGame(java.lang.String gameName)
rejoinGame
public void rejoinGame(java.lang.String gameName,
int playerRequest)
joinGame
public void joinGame(java.lang.String playerName,
int playerRequest)
joinGame
public void joinGame(java.lang.String gameName,
int playerRequest,
java.lang.String playerName)
createNewGame
public void createNewGame(java.lang.String gameName)
withdraw
public void withdraw(java.lang.String proposalID)
opinion
public void opinion(java.lang.String proposalID,
java.lang.String reasoning)
amend
public void amend(Proposal prop)
callForVote
public void callForVote(java.lang.String proposalID)
vote
public void vote(int vote)
votingTimerExpired
public void votingTimerExpired()
sendChatMessage
public 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. 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 NetClient
- Parameters:
user
- user sending the chat messagemessage
- the chat message that needs to be sent