|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectnet.bluebones.boggle.Player
public abstract class Player
Represents the entire client side of Boggle.
| Constructor Summary | |
|---|---|
Player()
|
|
| Method Summary | |
|---|---|
boolean |
connecting()
Gets whether this machine is in the process of connecting to another machine. |
String |
connectingTo()
Gets the address of the machine this Player is currently
trying to connect to. |
void |
createRegistry(int port)
Creates an RMI Registry on the specified port for this Player. |
void |
endGame()
Ends the game and returns words to the host of the game. |
Client |
getClient()
Gets the Client being used by this player. |
NamedClient[] |
getClients()
Gets the NamedClients attached to this player. |
Game |
getGame()
Gets the game this Player is currently playing. |
HostInfo |
getHostInfo()
Gets the HostInfo currently being used by this player. |
abstract IServer |
getLocalServer()
Gets the local server. |
int |
getPort()
Gets the port that the RMI Registry is running on. |
Registry |
getRegistry()
Gets the RMI Registry in use by this player. |
IServer |
getRemoteServer()
Gets the remote server. |
abstract String[] |
getWords()
Get the words this Player has found this round. |
void |
hostConnectionLost()
Takes the appropriate action after losing connection to a host. |
abstract void |
info(String msg)
Relays the specified message to the user. |
abstract void |
init(char[][] letters,
int timeInSecs)
Initializes this Player with a board of letters and
time for the round. |
void |
joinGame(GameInfo gameInfo)
Joins this player into an existing game. |
abstract void |
problem(String msg)
Notifies the user of the specified problem. |
abstract void |
results(Round round)
Called when results are published. |
void |
setClient(Client client)
Removes the old client in use by this Player (if any) and
sets a new one. |
void |
setConnecting(String to)
Sets the address this Player is currently connecting to. |
abstract void |
setConnection(ConnectionType type,
String address,
int clients)
Sets the current connection details. |
abstract void |
setConnection(ConnectionType type,
String address,
int clients,
int dots)
Sets the current connection details with a number of dots to show progress. |
void |
setGame(Game game)
Sets the game this Player is currently playing. |
void |
setHostInfo(HostInfo hostInfo)
Sets the host details to be used by this Player. |
abstract void |
setLocalServer(Server server)
Sets the local server. |
void |
setNotConnecting()
Updates this Player so that it knows it is not connecting to
any other machine (either because it has connected or because it has
given up). |
void |
setRegistry(Registry registry)
Sets the RMI Registry to be used by this Player. |
void |
setRemoteServer(IServer server)
Sets the remote server. |
abstract void |
setRubber(Rubber r)
To be implemented by subclasses to deal with Rubber details
as they see fit (display, etc.) Subclasses must deal with the possibilty
of a null Rubber being passed in. |
abstract void |
setTimer(int tenthsOfASecond)
Sets the timer to the specified amount in tenths of a second |
void |
startLocalGame(char[][] letters,
int timeInSecs)
Starts a game for this player. |
abstract void |
stopGame()
Implemented by the subclassed Player to do anything
necessary at the end of a game (cleanup, marshalling of words and so
on). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Player()
| Method Detail |
|---|
public abstract void info(String msg)
msg - Message to relay.public abstract void problem(String msg)
msg - Message to relay.
public void startLocalGame(char[][] letters,
int timeInSecs)
letters - Letters to populate the board with.timeInSecs - Duration of game.public abstract void stopGame()
Player to do anything
necessary at the end of a game (cleanup, marshalling of words and so
on).
public abstract String[] getWords()
Player has found this round.
String[] of words found.public void endGame()
public void joinGame(GameInfo gameInfo)
gameInfo - Player-supplied host info to use to connect to the
host.public abstract IServer getLocalServer()
null if this Player is not
currently hosting a game.
null.public IServer getRemoteServer()
null if this Player is not
currently the client of another server.
null.public Client getClient()
public HostInfo getHostInfo()
public abstract void setLocalServer(Server server)
Player is acting as a host.
server - Server to set as local server or null to
unset.public void setRemoteServer(IServer server)
null
this Player is a client of the remote server.
server - IServer to set as remote server or null to
unset.public void setClient(Client client)
Player (if any) and
sets a new one.
client - Client to use as client for this
Player.
public abstract void setConnection(ConnectionType type,
String address,
int clients)
type - ConnectionType type of connection.address - String address connected to.clients - int number of clients attached to this
Player.
public abstract void setConnection(ConnectionType type,
String address,
int clients,
int dots)
type - ConnectionType type of connection.address - String address connected to.clients - int number of clients attached to this
Player.dots - int number of dots to be displayed by the
client at this time. Maximum of three.public void setHostInfo(HostInfo hostInfo)
Player.
hostInfo - HostInfo host details to set.public void hostConnectionLost()
public int getPort()
public NamedClient[] getClients()
NamedClients attached to this player.
NamedClient[] of the clients or an empty array if
this Player is not hosting a game currently.public abstract void setRubber(Rubber r)
Rubber details
as they see fit (display, etc.) Subclasses must deal with the possibilty
of a null Rubber being passed in.
r - Rubber details to deal with.public abstract void setTimer(int tenthsOfASecond)
tenthsOfASecond - Amount to set the display to in tenths of
a second.
public abstract void init(char[][] letters,
int timeInSecs)
Player with a board of letters and
time for the round.
letters - char[][] of letters on the board.timeInSecs - int time of the round in seconds.public abstract void results(Round round)
round - Round result details.public void createRegistry(int port)
Player.
port - int TCP port to create registry on.public Game getGame()
Player is currently playing.
Game game being played.public void setGame(Game game)
Player is currently playing.
game - Game this player is about to play.public boolean connecting()
boolean.public String connectingTo()
Player is currently
trying to connect to.
String address of the machine being connected to.public void setNotConnecting()
Player so that it knows it is not connecting to
any other machine (either because it has connected or because it has
given up).
public void setConnecting(String to)
Player is currently connecting to.
to - String address being connected to.public Registry getRegistry()
Registry currently in use.public void setRegistry(Registry registry)
Player.
registry - Registry to use.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||