public class GameController
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static int |
HOST_PORT |
|
static int |
SQUARE_SIZE |
Constructor | Description |
---|---|
GameController() |
Modifier and Type | Method | Description |
---|---|---|
void |
applyMove(Move move) |
Apply the given move to the board state
|
void |
close() |
Close the game
|
void |
sendMove(Move move) |
Send the given move to the server
|
void |
setUsername(java.lang.String name) |
Set the local player's username
|
void |
showGameEndDialog() |
Show a dialog box displaying the winner of the game
|
void |
showOpponentDisconnectDialog() |
Show a dialog displaying that the opponent has been disconnected from the server
|
void |
startClient(java.lang.String hostname) |
Start the client connection to the host
|
void |
startGame(java.lang.String opponentUsername) |
Start the game
|
void |
startHost(java.lang.String username) |
Start the host for the game
|
public static final int HOST_PORT
public static final int SQUARE_SIZE
public void setUsername(java.lang.String name)
name
- public void startHost(java.lang.String username)
public void startClient(java.lang.String hostname)
hostname
- The hostname to connect topublic void startGame(java.lang.String opponentUsername)
opponentUsername
- The username of the opponentpublic void sendMove(Move move)
move
- The move to sendpublic void applyMove(Move move)
move
- The move to apply to the board statepublic void close()
public void showGameEndDialog()
public void showOpponentDisconnectDialog()