All Packages Class Hierarchy This Package Previous Next Index
Class game.GameLinkFilter
java.lang.Object
|
+----game.GameLinkFilter
- public class GameLinkFilter
- extends Object
- implements GameLinkListener
When a Jags client is connected to a Jags server, it can open multiple games
on this server. All those games will share the same GameLink
object,
so we need a way to sort network messages addressed to different games. This is
done through the GameLinkFilter
class.
-
gameId
- The id of the game this
GameLinkFilter
corresponds to.
-
gameLink
- The underlying
GameLink
object.
-
listeners
-
Set of listeners of this
GameLinkFilter
object.
-
GameLinkFilter(Object, GameLink)
- Creates a new GameLinkFilter [DESCRIBE ME]
-
addGameLinkListener(GameLinkListener, int)
- Adds the specified listener to the sets of listeners of this
GameLinkFilter
object.
-
deleteGameLinkListener(GameLinkListener, int)
- Removes the specified listener from the sets of listeners of this
GameLink
object for the given group.
-
frameReceived(Object, LinkFrame)
- Messaged when a new data frame is received by the
GameLink
object and this frame belongs to the groups the GameLinkListener
asked to listen to.
-
notifyListeners(LinkFrame)
- experimental.
-
send(LinkFrame)
- Sends the given frame over the network.
-
sendBlindly(LinkFrame)
- experimental.
listeners
Hashtable listeners
- Set of listeners of this
GameLinkFilter
object.
gameLink
GameLink gameLink
- The underlying
GameLink
object.
gameId
Object gameId
- The id of the game this
GameLinkFilter
corresponds to.
GameLinkFilter
public GameLinkFilter(Object id,
GameLink gameLink)
- Creates a new GameLinkFilter [DESCRIBE ME]
send
public void send(LinkFrame frame) throws IOException
- Sends the given frame over the network. The frame will be tagged according
to the game id.
- Throws: IOException
- thrown if an error occured during the sending
of the frame
- See Also:
- sendBlindly, sendBlindly
sendBlindly
public void sendBlindly(LinkFrame frame)
- experimental.
- See Also:
- send, send
frameReceived
public void frameReceived(Object link,
LinkFrame frame)
- Messaged when a new data frame is received by the
GameLink
object and this frame belongs to the groups the GameLinkListener
asked to listen to.
- Parameters:
- frame - the frame that has just been received.
- See Also:
- GameLink
addGameLinkListener
public synchronized void addGameLinkListener(GameLinkListener listener,
int group)
- Adds the specified listener to the sets of listeners of this
GameLinkFilter
object. The listener will listen only to the
messages related to the group.
- Parameters:
- listener - the specified listener to be added.
- gameId - the group of messages the listener wants listen to.
deleteGameLinkListener
public synchronized void deleteGameLinkListener(GameLinkListener listener,
int group)
- Removes the specified listener from the sets of listeners of this
GameLink
object for the given group.
- Parameters:
- listener - the listener to be removed from the set.
- gameId - the given group.
notifyListeners
void notifyListeners(LinkFrame frame)
- experimental.
All Packages Class Hierarchy This Package Previous Next Index