|
|||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
bluegammon.io
package defines common behaviour for setting up a remote game, and
contains one implementation of this using bluetooth.
See:
Description
Interface Summary | |
BackgammonConnection | This interface defines needed methods for connecting to another device on a remote backgammon game. |
Class Summary | |
BackgammonBTConnection | Implementation of the interface BackgammonConnection for
bluetooth bearer. |
BluetoothFacade | Facade for JSR82, connecting via the btspp protocol. |
Handshake |
A Handshake consists of sending and receiving data as specified
below, where one player has server role and the other has client role.
|
PlayerListenerProxy |
This class serializes all events from sent to a PlayerListener and
sends them to specified output stream.
|
The bluegammon.io
package defines common behaviour for setting up a remote game, and
contains one implementation of this using bluetooth.
There are three central classes in this package:
BackgammonConnection
- a high level interface that defines methods for connecting
to another backgammon player's server or setting up a backgammon server on the local deviceHandshake
- a class that defines the protocol for handshaking, either from server
side or from client sidePlayerListenerProxy
- an implementation of the PlayerListener
interface
that listens to the LocalPlayer
on this device and serializes all events. It sends the
events further via the streams setup by the BackgammonConnection
to a RemotePlayer
that resides on the remote device. Hence, the RemotePlayer
will receive same events as the
LocalPlayerProxy
A class diagram over a fully setup distributed game is depicted below:
Here, the RemotePlayer
receives events via its InputStream
. The
PlayerListenerProxy
sends all events from PlayerListener
via its
OutputStream
.
|
|||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |