|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--breakout.StudentConnector
class StudentConnector is a possibly student-written class that implements the connection between the local breakout game and the partner's breakout game.
World
,
NetworkSettings
,
WorldListener
Constructor Summary | |
StudentConnector(World local,
World remote,
NetworkSettings settings)
|
Method Summary | |
void |
ballLeft(WorldEvent event)
invoked when a ball leaves the world for another. |
void |
componentAdded(WorldEvent event)
invoked when a component is added to the world. |
void |
componentRemoved(WorldEvent event)
invoked when a component is removed from the world. |
void |
connect()
The connector implementation should attempt to connect to the other party. |
boolean |
isConnected()
returns true if the connector is connected to the partner game. |
void |
run()
reads WorldEvents off the network and adds or removes components as directed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StudentConnector(World local, World remote, NetworkSettings settings)
Method Detail |
public void componentAdded(WorldEvent event)
WorldListener
componentAdded
in interface WorldListener
event
- contains basic details of component that
was added.public void componentRemoved(WorldEvent event)
WorldListener
componentRemoved
in interface WorldListener
event
- contains basic details of component that
was added.public void ballLeft(WorldEvent event)
WorldListener
ballLeft
in interface WorldListener
event
- contains basic details of ball that left.public void run()
run
in interface Runnable
public void connect()
Connector
connect
in interface Connector
public boolean isConnected()
Connector
isConnected
in interface Connector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |