|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectnet.bluebones.boggle.Player
net.bluebones.boggle.HumanPlayer
public class HumanPlayer
Represents the entire client side of Boggle.
| Constructor Summary | |
|---|---|
HumanPlayer()
Initialises a new HumanPlayer. |
|
| Method Summary | |
|---|---|
void |
checkResultsSend()
Periodic check that sends results to clients if it is the appropriate time. |
NamedClient[] |
getClients()
Gets the clients currently attached to this player. |
IServer |
getLocalServer()
Gets the local server. |
GameId |
getServerGameId()
Gets the GameId of the game running on this player's local
server. |
String[] |
getWords()
Gets this player's words for this turn. |
void |
hostGame(GameInfo gameInfo)
Sets up this player as the host of a game. |
void |
info(String msg)
Relays the specified message to the user. |
void |
init(char[][] letters,
int timeInSecs)
Initializes the display of this player. |
boolean |
isHost()
Determines if this player is currently hosting a game. |
void |
problem(String msg)
Notifies the user of the specified problem. |
void |
removeClients(Collection clients)
Removes all clients in clients from this player's local
(host) server. |
void |
results(Round round)
Displays the results of a round to the player. |
void |
setConnection(ConnectionType type,
String address,
int clients)
Sets the displayed connection for this player. |
void |
setConnection(ConnectionType type,
String address,
int clients,
int dots)
Sets the displayed connection for this player. |
void |
setLocalServer(Server server)
Sets the local server. |
void |
setRubber(Rubber r)
Set the displayed rubber information. |
void |
setTimer(int tenthsOfASecond)
Sets the timer to the specified time. |
void |
startNetworkGame()
Starts a network game, setting up a Server on this host or using the existing one. |
void |
stopGame()
Ends the game and returns words to the host of the game. |
| Methods inherited from class net.bluebones.boggle.Player |
|---|
connecting, connectingTo, createRegistry, endGame, getClient, getGame, getHostInfo, getPort, getRegistry, getRemoteServer, hostConnectionLost, joinGame, setClient, setConnecting, setGame, setHostInfo, setNotConnecting, setRegistry, setRemoteServer, startLocalGame |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HumanPlayer()
| Method Detail |
|---|
public void info(String msg)
info in class Playermsg - Message to relay.public void problem(String msg)
problem in class Playermsg - Message to relay.public void startNetworkGame()
public void stopGame()
stopGame in class Playerpublic String[] getWords()
getWords in class PlayerString[] of words the player has found this turn.public void hostGame(GameInfo gameInfo)
gameInfo - Player-supplied host info to help set up the host.public IServer getLocalServer()
null if this HumanPlayer is not
currently hosting a game.
getLocalServer in class Playernull.public void setLocalServer(Server server)
setLocalServer in class Playerserver - Server to set as local server or null to
unset.public boolean isHost()
boolean.
public void setConnection(ConnectionType type,
String address,
int clients)
setConnection in class Playertype - ConnectionType of connection.address - Address of host.clients - Number of clients currently attached to this connection.
public void setConnection(ConnectionType type,
String address,
int clients,
int dots)
setConnection in class Playertype - ConnectionType of connection.address - Address of host.clients - Number of clients currently attached to this connection.dots - Number of dots to display after the address. For use in
showing some animation while connecting.public NamedClient[] getClients()
getClients in class PlayerNamedClient[] of the attached clients.public void removeClients(Collection clients)
clients from this player's local
(host) server.
clients - Collection of clients to remove.public void setRubber(Rubber r)
setRubber in class Playerr - Rubber information to set.public void setTimer(int tenthsOfASecond)
setTimer in class PlayertenthsOfASecond - Amount to display in tenths of a second.
public void init(char[][] letters,
int timeInSecs)
init in class Playerletters - Letters to initialize the board with.timeInSecs - Duration of game in seconds.public void results(Round round)
results in class Playerround - Round to display.public void checkResultsSend()
public GameId getServerGameId()
GameId of the game running on this player's local
server.
GameId.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||