public class PlayerClientToServerConnection extends ObserverClientToServerConnection implements IPlayerClientToServerConnection
gameModel
dataOutputStream
Constructor and Description |
---|
PlayerClientToServerConnection(IClientToServerConnectionCallable callbackObject,
String networkAddress) |
Modifier and Type | Method and Description |
---|---|
void |
sendGameJoinRequest(int gameId,
String clientName,
Role role)
Sends a GameJoinRequest to the server.
|
void |
sendSetTileCmd(Tile tile)
Sends a SetTileCmd to the server.
|
void |
sendSetTileCmd(Tile tile,
Position position)
Sends a SetTileCmd to the server.
|
void |
sendSetTokenCmd(Gate gate)
Sends a SetTokenCmd to the server.
|
connectionResetCallback, getNetworkAddress, processInputObject, sendGameJoinRequest, sendGameJoinRequestWithRole, sendGameListRequest
close, sendObject, setSocket
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNetworkAddress, sendGameJoinRequest, sendGameListRequest
public PlayerClientToServerConnection(IClientToServerConnectionCallable callbackObject, String networkAddress) throws IOException
IOException
public void sendSetTileCmd(Tile tile, Position position)
IPlayerClientToServerConnection
sendSetTileCmd
in interface IPlayerClientToServerConnection
tile
- the tile to be placedposition
- the position to place the tile atpublic void sendSetTileCmd(Tile tile)
IPlayerClientToServerConnection
sendSetTileCmd
in interface IPlayerClientToServerConnection
tile
- the tile to be placedpublic void sendSetTokenCmd(Gate gate)
IPlayerClientToServerConnection
sendSetTokenCmd
in interface IPlayerClientToServerConnection
gate
- the gate to place the token atpublic void sendGameJoinRequest(int gameId, String clientName, Role role)
IPlayerClientToServerConnection
sendGameJoinRequest
in interface IPlayerClientToServerConnection
gameId
- the Id of the game the client would like to join (-1 if client wants to join the general game pool)clientName
- the name the user wants to takerole
- the Role the client would like to takeCopyright © 2017 smarTen. All rights reserved.