dk.itu.smds.torusman
Class ServerSender

java.lang.Object
  extended by dk.itu.smds.torusman.ServerSender

public class ServerSender
extends java.lang.Object

The Class ServerSender handles the sending of packages to all the connected clients.


Field Summary
 int latestAdd
          The latest add.
 boolean newMove
          The new move.
 boolean newScore
          The new score.
 java.io.DataOutputStream[] outs
          The outs.
 
Constructor Summary
ServerSender(int size)
          Instantiates a new server sender.
 
Method Summary
 void addSender(java.io.DataOutputStream out)
          Adds the sender.
 void sendMove(ManData m, byte x, byte y)
          Send move.
 void sendScore(byte manId, byte teamId, int points)
          Send score.
 void sendTime(int time, int conId)
          Send time.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outs

public java.io.DataOutputStream[] outs
The outs.


latestAdd

public volatile int latestAdd
The latest add.


newScore

public boolean newScore
The new score.


newMove

public boolean newMove
The new move.

Constructor Detail

ServerSender

public ServerSender(int size)
Instantiates a new server sender.

Parameters:
size - the size
Method Detail

addSender

public void addSender(java.io.DataOutputStream out)
Adds the sender.

Parameters:
out - the out

sendMove

public void sendMove(ManData m,
                     byte x,
                     byte y)
Send move.

Parameters:
m - the m
x - the x
y - the y

sendTime

public void sendTime(int time,
                     int conId)
Send time.

Parameters:
time - the time
conId - the con id

sendScore

public void sendScore(byte manId,
                      byte teamId,
                      int points)
Send score.

Parameters:
manId - the man id
teamId - the team id
points - the points