|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MasterEngine
The master engine propagates changes to remote engines.
Constructor Summary | |
MasterEngine()
|
Method Summary | |
int |
addBody(Body body)
Add body to game, assigning it an unique id#. |
void |
addClient(REngine e)
|
void |
bodyChanged(Body body)
A body advertises unprojectable state changes with this method. |
Body |
getBody(int id)
|
java.util.Timer |
getTimer()
|
void |
removeBody(Body body)
|
void |
removeBody(int id)
Remove body by id provided for server bits. |
void |
removeClient(REngine e)
|
void |
replaceBody(Body out,
Body in)
|
void |
replaceBody(int id,
Body body)
Replace body by id provided for server bits. |
boolean |
setAcceleration(int id,
boolean start)
|
boolean |
setFire(int id,
boolean start)
|
boolean |
setTurn(int id,
int direction)
Change rotation of a ship. |
void |
setWorld(World newWorld)
|
java.util.ArrayList |
snapshotBodies()
Get a shallow copy of the world's bodies in an ArrayList. |
void |
stop()
Stopping cancels all activity of the master engine. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MasterEngine()
Method Detail |
public java.util.Timer getTimer()
public Body getBody(int id)
public void setWorld(World newWorld)
setWorld
in interface IMasterEngine
public int addBody(Body body)
IMasterEngine
addBody
in interface IMasterEngine
public void removeBody(Body body)
public void removeBody(int id)
public void replaceBody(Body out, Body in)
public void replaceBody(int id, Body body)
replaceBody
in interface IMasterEngine
public void addClient(REngine e)
addClient
in interface IMasterEngine
public void removeClient(REngine e)
public boolean setTurn(int id, int direction)
IMasterEngine
setTurn
in interface IMasterEngine
IMasterEngine
id
- id# of bodydirection
- 1 turns left, 0 stops rotation, -1 turns right.public boolean setAcceleration(int id, boolean start)
setAcceleration
in interface IMasterEngine
public boolean setFire(int id, boolean start)
setFire
in interface IMasterEngine
public void bodyChanged(Body body)
public java.util.ArrayList snapshotBodies()
public void stop()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |