|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread net.jetrix.Channel
public class Channel
Game channel.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Channel()
|
|
Channel(ChannelConfig channelConfig)
|
Method Summary | |
---|---|
void |
addFilter(FilterConfig filterConfig)
Enable a new filter for this channel. |
void |
close()
Stop the channel. |
Client |
getClient(int slot)
Returns the client in the specified slot. |
int |
getClientSlot(Client client)
Finds the slot used in the channel by the specified client. |
ChannelConfig |
getConfig()
Returns the channel configuration. |
Field |
getField(int slot)
Return the field of the specified slot. |
Iterator<MessageFilter> |
getFilters()
|
GameState |
getGameState()
Returns the game state. |
User |
getPlayer(int slot)
Returns the client in the specified slot. |
int |
getPlayerCount()
Returns the number of players currently in this chanel. |
Iterator<Client> |
getPlayers()
Return an iterator of players in this channel. |
Iterator<Client> |
getSpectators()
Return an iterator of spectators observing this channel. |
boolean |
isEmpty()
|
boolean |
isFull()
Tell if the channel can accept more players. |
void |
process(Message m)
|
void |
process(PlayerSwitchMessage m)
|
void |
removeClient(Client client)
Remove the specified client from the channel. |
void |
removeFilter(String filterName)
|
void |
run()
Main loop. |
void |
send(Message message)
Add a message to the channel message queue. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 Channel()
public Channel(ChannelConfig channelConfig)
Method Detail |
---|
public void addFilter(FilterConfig filterConfig)
public void removeFilter(String filterName)
public Iterator<MessageFilter> getFilters()
public void run()
run
in interface Runnable
run
in class Thread
public void close()
public void process(PlayerSwitchMessage m)
public void process(Message m)
public void removeClient(Client client)
public void send(Message message)
send
in interface Destination
message
- message to addpublic boolean isFull()
public boolean isEmpty()
public int getPlayerCount()
public ChannelConfig getConfig()
public GameState getGameState()
public int getClientSlot(Client client)
public Client getClient(int slot)
slot
- slot number between 1 and 6
public User getPlayer(int slot)
slot
- slot number between 1 and 6
public Iterator<Client> getPlayers()
public Iterator<Client> getSpectators()
public Field getField(int slot)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |