public class Server
extends java.lang.Object
| Constructor and Description |
|---|
Server(int portNumber) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addUser(User u) |
void |
begin()
Tell the server that the player is ready
|
void |
broadcast(Response response) |
void |
draw()
Draw cards for all users
|
void |
draw(Worker worker)
Draw new cards for a specific user
|
int |
getActiveCount() |
java.lang.Iterable<User> |
getActiveUserList() |
State |
getGameState() |
Simulator |
getSimulator() |
double |
getTimeDiff(long curr)
Get the time of server spawn time to a given time.
|
User |
getUserByUsername(java.lang.String username) |
int |
getUserCount() |
java.lang.Iterable<User> |
getUserList() |
Worker |
getWorkerByRegion(EnumRegion region) |
void |
killServer() |
static void |
main(java.lang.String[] args) |
double |
uptime() |
java.lang.String |
uptimeString() |
void |
vote() |
void |
waitForConnection(int port)
Wait for a connection.
|
public double getTimeDiff(long curr)
curr - is the current timepublic void waitForConnection(int port)
port - port to listen on.public static void main(java.lang.String[] args)
public java.lang.String uptimeString()
public double uptime()
public Simulator getSimulator()
public User getUserByUsername(java.lang.String username)
public Worker getWorkerByRegion(EnumRegion region)
public java.lang.Iterable<User> getUserList()
public boolean addUser(User u)
public int getActiveCount()
public java.lang.Iterable<User> getActiveUserList()
public int getUserCount()
public void begin()
public void vote()
public void draw(Worker worker)
public void draw()
public void broadcast(Response response)
public void killServer()
public State getGameState()