|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
sv.net.NetDaemon
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
NetDaemon()
|
Method Summary | |
void |
closeDown()
Close connection with other computer. |
boolean |
establishConnection()
Try to establish connection with oter instance; hostname an port have to be set |
void |
run()
|
int |
sendName(java.lang.String n)
|
int |
sendReady()
|
void |
setController(Controller c)
Set instance of the controller of the running game; maybe necessary to communicate while playing |
void |
setGame(Game g)
Set instance of running game; maybe necessary to communicate while playing |
void |
setHost(java.lang.String s)
Set adress of other instance |
void |
setPort(int i)
Set the port number, on which the other instance is listening |
int |
shoot(int x,
int y)
|
int |
syncAmmo(int a)
|
boolean |
waitForConnection()
Waits for connection on set port. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NetDaemon()
Method Detail |
public void setHost(java.lang.String s)
s
- adress of another computer (either ip adress or url)public void setPort(int i)
i
- port numberpublic void setGame(Game g)
g
- Instance of Gamepublic void setController(Controller c)
c
- public boolean establishConnection()
public boolean waitForConnection()
public int shoot(int x, int y)
public int syncAmmo(int a)
public int sendReady()
public int sendName(java.lang.String n)
public void run()
public void closeDown()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |