public class AIConnectionHandler extends Object implements de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
Constructor and Description |
---|
AIConnectionHandler(AIConfig config) |
Modifier and Type | Method and Description |
---|---|
void |
close()
closes the current connection
|
void |
connect()
connects to the currently set server
|
void |
connectionResetCallback() |
void |
finishNotificationCallback() |
void |
gameContinueNotificationCallback() |
void |
gameListResponseCallback(List<de.smarten.tsuro.shared.gamemodel.Game> gameList) |
void |
gamePauseNotificationCallback() |
void |
gameStartNotificationCallback() |
AIConfig |
getAIConfig() |
void |
initClientToServerConnection(String ip)
creates a
PlayerClientToServerConnection object. |
boolean |
isConnected() |
boolean |
isQueued() |
void |
kickNotificationCallback(List<de.smarten.tsuro.shared.gamemodel.Player> kickedPlayers) |
void |
processingRequestReplyCallback(de.smarten.tsuro.shared.gamemodel.JoinResponse response,
int clientId) |
void |
requestGameList() |
void |
sendJoinRequest(int gameID)
Instructs the connection object to send a gameJoinRequest
|
void |
sendSetTileCommand(de.smarten.tsuro.shared.gamemodel.Tile tile)
Instructs the connection object to send a setTileCommand
|
void |
sendSetTileCommand(de.smarten.tsuro.shared.gamemodel.Tile tile,
de.smarten.tsuro.shared.gamemodel.Position position)
Instructs the connection object to send a setTileCommand
|
void |
sendSetTokenCommand(de.smarten.tsuro.shared.gamemodel.Gate gate)
Instructs the connection object to send a setTokenCommand
|
void |
startGame(de.smarten.tsuro.shared.gamemodel.GameModel gameModel) |
void |
turnNotificationCallback(boolean placeToken) |
public AIConnectionHandler(AIConfig config)
public boolean isConnected()
public boolean isQueued()
public AIConfig getAIConfig()
public void requestGameList()
public void gameListResponseCallback(List<de.smarten.tsuro.shared.gamemodel.Game> gameList)
gameListResponseCallback
in interface de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
public void processingRequestReplyCallback(de.smarten.tsuro.shared.gamemodel.JoinResponse response, int clientId)
processingRequestReplyCallback
in interface de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
public void gameStartNotificationCallback()
gameStartNotificationCallback
in interface de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
public void startGame(de.smarten.tsuro.shared.gamemodel.GameModel gameModel)
startGame
in interface de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
public void turnNotificationCallback(boolean placeToken)
turnNotificationCallback
in interface de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
public void gamePauseNotificationCallback()
gamePauseNotificationCallback
in interface de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
public void gameContinueNotificationCallback()
gameContinueNotificationCallback
in interface de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
public void kickNotificationCallback(List<de.smarten.tsuro.shared.gamemodel.Player> kickedPlayers)
kickNotificationCallback
in interface de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
public void finishNotificationCallback()
finishNotificationCallback
in interface de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
public void connectionResetCallback()
connectionResetCallback
in interface de.smarten.tsuro.shared.network.client.IClientToServerConnectionCallable
public void connect()
public void close()
public void initClientToServerConnection(String ip)
PlayerClientToServerConnection
object.ip
- The IP address of the server you want to connect to.public void sendJoinRequest(int gameID)
gameID
- The ID of the game to joinpublic void sendSetTileCommand(de.smarten.tsuro.shared.gamemodel.Tile tile)
tile
- the tile to be put on the board (incl. rotation)public void sendSetTileCommand(de.smarten.tsuro.shared.gamemodel.Tile tile, de.smarten.tsuro.shared.gamemodel.Position position)
tile
- the tile to be put on the board (incl. rotation)position
- the position at which the tile should be placedpublic void sendSetTokenCommand(de.smarten.tsuro.shared.gamemodel.Gate gate)
gate
- The gate the token should be placed atCopyright © 2017 smarTen. All rights reserved.