|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISimulatorNet
The interface of a simulator as seen by the network layer
Field Summary |
---|
Fields inherited from interface simulator.model.ISimulatorView |
---|
BALL_RADIUS, FIELD_LENGTH, FIELD_WIDTH, GOAL_WIDTH, NUMBER_OF_PLAYERS, PLAYER_RADIUS |
Method Summary | |
---|---|
void |
accelerate(Side side,
int p,
double a)
Sets the acceleration for the player |
void |
endGame()
Indicates game should end due to a request from one or more teams. |
void |
kick(Side side,
int p,
double v,
double alpha)
Updates field data in response to a kick request |
void |
placeBall(CartesianVect l)
placeBall places ball at given coordinates |
void |
placePlayer(Side side,
int p,
CartesianVect l)
places player at given coordinates |
void |
setNet(INetSimulator n)
Set the network layer. |
void |
setTeams(Student west,
Student east)
Indicates which team is on each side. |
void |
setTime(int t)
setTime sets game time |
void |
spin(Side side,
int p,
double av)
Sets angular velocity for the player |
void |
startGame()
Indicates that game should start (time == 0). |
Methods inherited from interface simulator.model.ISimulatorView |
---|
getBallPosition, getBallVelocity, getFieldName, getISimulatorNet, getPlayerPosition, getPlayerVelocity, getStatusMessage, getTeamName, getTeamScore, getTime, isGameInProgress, isPlayerInGame, setTestMode |
Method Detail |
---|
void setTeams(Student west, Student east)
west
- team on WEST side.east
- team on EAST side.void startGame()
Precondidtion: setTeams and setNet have been called and
isGameInProgress() is false.
Postcondition: isGameInProgress()
void endGame()
Precondition: true
Postcondition: !isGameInProgress()
void setNet(INetSimulator n)
n
- void spin(Side side, int p, double av)
Precondition: isGameInProgress()
p
- Player number in {0, 1, 2, 3, 4}av
- double Angular velocity in degrees per second. -90 <= av <= 90void accelerate(Side side, int p, double a)
Precondition: isGameInProgress()
p
- Player number, in {0, 1, 2, 3, 4}a
- rate of acceleration, -5 <= a <= 1void kick(Side side, int p, double v, double alpha)
Precondition: isGameInProgress()
side
- the team sidep
- Player number, in {0, 1, 2, 3, 4}v
- Change in the ball's velocity. 0 <= v <= 10alpha
- Offset in degrees from a line connecting the player's
centre to the ball's centre. -45 <= alpha <= 45void placePlayer(Side side, int p, CartesianVect l)
Precondition: game is in test mode
side
- Player teamp
- Player number. In {0, 1, 2, 3, 4}l
- new location for playervoid placeBall(CartesianVect l)
Precondition: game is in test mode
l
- location to place the ballvoid setTime(int t)
Precondition: game is in test mode
t
- int Game time is set to t (in miliseconds)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |