|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface acts as a filter between the server and the outside world. The server calls the methods here whenever something happens, and the class implementing this interface is then responsible for censoring this information before passing it on to the clients.
Method Summary | |
void |
actionBlocked(Unit unit,
ActionDefinition action,
boolean isBlocked)
This method should be called whenever an action becomes blocked or unblocked. |
void |
actionCompleted(Action action,
boolean wasSuccessful)
This method is to be called whenever the execution of an action is finished. |
void |
actionRejected(String role,
int actionHandle)
This method is to be called when a role requests that an action be carried out, and that is for some reason impossible. |
void |
deleteUnit(Unit unit,
double lastKnownX,
double lastKnownY)
This method is to be called whenever a unit is permanently taken off the map (typically, when it is killed). |
void |
resendAllData(String role)
This method causes the server to resend all data to a role that the clients playing that role should know (and should be caching). |
void |
roleMessage(String role,
Unit unit,
String message)
This method may be called to pass some information to a specific role regarding a unit. |
void |
timeUpdate(String time)
This method may be called to tell the clients that some time has passed. |
void |
unitMessage(Unit unit,
String message)
This method may be called to pass some information to the owner of a unit. |
void |
unitPropertyChanged(Unit unit,
String key,
String newValue)
This method should be called whenever a unit property changes. |
void |
updateAutomatonState(int x,
int y,
int c)
This method is to be called whenever an automaton changes state. |
void |
updateUnitPosition(Unit unit,
double oldX,
double oldY,
double newX,
double newY)
This method is to be called whenever a unit changes its position. |
Method Detail |
public void updateAutomatonState(int x, int y, int c)
x
- The X coordinate of the automaton.y
- The Y coordinate of the automaton.c
- The new color of the automaton.public void updateUnitPosition(Unit unit, double oldX, double oldY, double newX, double newY)
unit
- The unit.oldX
- The unit's old X coordinate.oldY
- The unit's old Y coordinate.newX
- The unit's new X coordinate.newY
- The unit's new Y coordinate.public void deleteUnit(Unit unit, double lastKnownX, double lastKnownY)
unit
- The unit.lastKnownX
- The unit's last X coordinate.lastKnownY
- The unit's last Y coordinate.public void actionBlocked(Unit unit, ActionDefinition action, boolean isBlocked)
unit
- The unit whose action gets blocked or unblocked.action
- The action that is now blocked or unblocked.isBlocked
- true if the action is blocked, false if it is unblocked.public void actionCompleted(Action action, boolean wasSuccessful)
action
- The action.wasSuccessful
- true if the action was successful, false
if it failed.public void actionRejected(String role, int actionHandle)
role
- The role.actionHandle
- The action handle.public void unitMessage(Unit unit, String message)
unit
- The unit.message
- The message to be delivered.public void roleMessage(String role, Unit unit, String message)
role
- The role.unit
- The unit.message
- The message to be delivered.public void timeUpdate(String time)
time
- A String representing the current game time.public void unitPropertyChanged(Unit unit, String key, String newValue)
unit
- The unit whose property changed.key
- The property that has changed.newValue
- The new value of the property.public void resendAllData(String role)
unit
- The unit whose property changed.key
- The property that has changed.newValue
- The new value of the property.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |