public class TextClient
extends java.lang.Object
implements ihs.apcs.spacebattle.networking.Client
Constructor and Description |
---|
TextClient(Spaceship<?> ship) |
Modifier and Type | Method and Description |
---|---|
void |
disconnect() |
boolean |
isDisconnected() |
void |
logMessage(java.lang.String message) |
static void |
main(java.lang.String[] args) |
<T> void |
parseMessage(ihs.apcs.spacebattle.networking.MwnpMessage msg)
Reads a network message and takes appropriate action.
|
static void |
run(java.lang.String ipAddress,
Spaceship<?> ship) |
static void |
run(java.lang.String ipAddress,
Spaceship<?> ship,
int socketNum) |
public TextClient(Spaceship<?> ship)
public static void main(java.lang.String[] args)
public static void run(java.lang.String ipAddress, Spaceship<?> ship)
public static void run(java.lang.String ipAddress, Spaceship<?> ship, int socketNum)
args
- java.io.IOException
public <T> void parseMessage(ihs.apcs.spacebattle.networking.MwnpMessage msg) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalAccessException
parseMessage
in interface ihs.apcs.spacebattle.networking.Client
msg
- the message received from the networkjava.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.io.IOException
public void disconnect() throws java.io.IOException
disconnect
in interface ihs.apcs.spacebattle.networking.Client
java.io.IOException
public boolean isDisconnected()
isDisconnected
in interface ihs.apcs.spacebattle.networking.Client
public void logMessage(java.lang.String message)
logMessage
in interface ihs.apcs.spacebattle.networking.Client