|
SmartFrog 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.smartfrog.sfcore.reference.RemoteReferenceResolverHelperImpl
org.smartfrog.sfcore.prim.PrimImpl
org.smartfrog.sfcore.workflow.eventbus.EventPrimImpl
org.smartfrog.examples.pong.GameArenaWrapper
public class GameArenaWrapper
A wrapper to turn the sfPong game into a SmartFrog component. Creates a Frame and gets a handle on the opponent if there is one.
| Field Summary | |
|---|---|
protected org.smartfrog.examples.pong.Linker |
opponent
The opponent. |
| Fields inherited from class org.smartfrog.sfcore.prim.PrimImpl |
|---|
refLivenessDelay, refLivenessFactor, sfCompleteName, sfContext, sfDeployHooks, sfDeployWithHooks, sfExportRef, sfIsDeployed, sfIsStarted, sfIsTerminated, sfIsTerminating, sfLivenessCount, sfLivenessDelay, sfLivenessFactor, sfLivenessSender, sfParent, sfStartHooks, sfTerminateWithHooks, termLock |
| Constructor Summary | |
|---|---|
GameArenaWrapper()
Standard constructor for SmartFrog components. |
|
| Method Summary | |
|---|---|
void |
ballIsLeaving(Ball ball)
Hide the ball on this host, then hand it over to the opponent. |
void |
handleEvent(java.lang.String event)
Handle an incoming message. |
void |
incomingBall(double xPos,
double yPos,
double xSpeed,
double ySpeed)
Implementation of the linker interface : reset the ball position and invert the horizontal speed. |
boolean |
setOpponent(org.smartfrog.examples.pong.Linker opponent)
Set the opponent of this player to be the Linker object provided if none already exists. |
void |
sfDeploy()
Collect data from the description. |
void |
sfStart()
Build a game frame and start the game. |
void |
sfTerminateWith(TerminationRecord tr)
sfTerminate. |
| Methods inherited from class org.smartfrog.sfcore.workflow.eventbus.EventPrimImpl |
|---|
deregister, event, handleEvent, register, sendEvent |
| Methods inherited from class org.smartfrog.sfcore.reference.RemoteReferenceResolverHelperImpl |
|---|
sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolveWithParser |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected org.smartfrog.examples.pong.Linker opponent
| Constructor Detail |
|---|
public GameArenaWrapper()
throws java.rmi.RemoteException
java.rmi.RemoteException - In case of network/rmi error| Method Detail |
|---|
public void sfDeploy()
throws SmartFrogException,
java.rmi.RemoteException
sfDeploy in interface PrimsfDeploy in class EventPrimImplSmartFrogException - In case of error while deploying
java.rmi.RemoteException - In case of network/rmi error
public void sfStart()
throws SmartFrogException,
java.rmi.RemoteException
sfStart in interface PrimsfStart in class PrimImplSmartFrogException - In case of error while starting
java.rmi.RemoteException - In case of network/rmi errorpublic void sfTerminateWith(TerminationRecord tr)
sfTerminateWith in class EventPrimImpltr - TerminationRecord object
public void incomingBall(double xPos,
double yPos,
double xSpeed,
double ySpeed)
throws java.lang.Exception
xPos - Position in x axisyPos - Position in y axisxSpeed - Speed in x axisySpeed - Speed in y axis
java.lang.Exception - error while setting position and speedpublic void ballIsLeaving(Ball ball)
ball - a Ball objectpublic void handleEvent(java.lang.String event)
event - incoming message
public boolean setOpponent(org.smartfrog.examples.pong.Linker opponent)
throws java.rmi.RemoteException
opponent - opponent
java.rmi.RemoteException - in case of network/rmi error
|
SmartFrog CORE 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||