sv
Class Controller

java.lang.Object
  extended byjava.lang.Thread
      extended bysv.Controller
All Implemented Interfaces:
java.lang.Runnable

public class Controller
extends java.lang.Thread

Directing the flow to the game

Author:
florian

Field Summary
static int CONNECT
          signalize connect (-action)
static int SERVE
          signalize serve (-action)
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Controller()
          Creates instances of must-have objects an initiates an option screen.
 
Method Summary
 Game getGame()
           
 NetDaemon getNetDaemon()
           
 View getView()
           
 void run()
          controller has to have some thread capabilities... why?
 void setAction(int a)
          Set action ... should be used to inform the controller, what to do while establishing a connection.
 void setInfo(java.lang.String name, java.lang.String url, java.lang.String port, int ammo)
          set information about the game; maybe necessary
 
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
 

Field Detail

CONNECT

public static final int CONNECT
signalize connect (-action)

See Also:
Constant Field Values

SERVE

public static final int SERVE
signalize serve (-action)

See Also:
Constant Field Values
Constructor Detail

Controller

public Controller()
Creates instances of must-have objects an initiates an option screen.

Method Detail

getNetDaemon

public NetDaemon getNetDaemon()
Returns:
the actual NetDaemon

getGame

public Game getGame()
Returns:
the running game

getView

public View getView()
Returns:
the view of the game

setAction

public void setAction(int a)
Set action ... should be used to inform the controller, what to do while establishing a connection.

Parameters:
a - uses controller's finals

setInfo

public void setInfo(java.lang.String name,
                    java.lang.String url,
                    java.lang.String port,
                    int ammo)
set information about the game; maybe necessary

Parameters:
name - playername
url - hostname or ip
port - portnumber
ammo - ammunition

run

public void run()
controller has to have some thread capabilities... why? ;-)