public class Client
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.net.Socket |
socket |
| Constructor and Description |
|---|
Client(java.net.Socket s) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTicTacToeListener(TicTacToeListener l) |
protected void |
fireBoardChanged() |
protected void |
fireCancelMove() |
protected void |
fireGameStatus(java.lang.String message) |
protected void |
fireMoveRequested() |
protected void |
fireSeatChanged(int seatNum) |
int |
getMySeat() |
java.lang.String |
getPlayerName(int seatNum) |
char |
getPlayerSymbol(int seatNum) |
protected void |
readPacket() |
void |
sendMyMove(int cellIndex) |
void |
start()
Starts listening for messages from the server.
|
public Client(java.net.Socket s)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getPlayerName(int seatNum)
public char getPlayerSymbol(int seatNum)
public int getMySeat()
public void start()
protected void readPacket()
throws java.io.IOException
java.io.IOExceptionpublic void sendMyMove(int cellIndex)
throws java.io.IOException
java.io.IOExceptionprotected void fireGameStatus(java.lang.String message)
protected void fireBoardChanged()
protected void fireSeatChanged(int seatNum)
protected void fireMoveRequested()
protected void fireCancelMove()
public void addTicTacToeListener(TicTacToeListener l)