|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgecco.server.visibility.VisibilityManager
Description of the Class
Constructor Summary | |
VisibilityManager(Client client)
Constructor for the VisibilityManager object |
Method Summary | |
void |
abortAllActions(Unit unit)
Abort all actions for a unit |
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. |
boolean |
canSeeAutomaton(String role,
int x,
int y,
Unit excludeUnit)
Description of the Method |
boolean |
canSeePosition(String role,
double x,
double y)
Description of the Method |
boolean |
canSeeUnit(String role,
Unit unit,
Unit excludeUnit)
Description of the Method |
void |
deleteUnit(Unit unit,
double lastKnownX,
double lastKnownY)
Description of the Method |
void |
resendAllData(String role)
Description of the Method |
void |
roleMessage(String role,
Unit unit,
String message)
This method may be called to pass some information to a specific role redarding 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 regarding a unit, such as when it has finished an action. |
void |
unitPropertyChanged(Unit unit,
String key,
String newValue)
This method should be called whenever a unit property changes. |
void |
updateAutomatonState(int x,
int y,
Color c)
Description of the Method |
void |
updateUnitPosition(Unit unit,
double oldX,
double oldY,
double newX,
double newY)
Description of the Method |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VisibilityManager(Client client)
client
- The client.Method Detail |
public boolean canSeePosition(String role, double x, double y)
canSeePosition
in interface VisibilityInfo
role
- Description of Parameterx
- Description of Parametery
- Description of Parameter
public void updateAutomatonState(int x, int y, Color c)
updateAutomatonState
in interface VisibilityFilter
x
- Description of Parametery
- Description of Parameterc
- Description of Parameterpublic boolean canSeeAutomaton(String role, int x, int y, Unit excludeUnit)
canSeeAutomaton
in interface VisibilityInfo
role
- Description of Parameterx
- Description of Parametery
- Description of ParameterexcludeUnit
- Description of Parameter
public boolean canSeeUnit(String role, Unit unit, Unit excludeUnit)
canSeeUnit
in interface VisibilityInfo
role
- Description of Parameterunit
- Description of ParameterexcludeUnit
- Description of Parameter
public void updateUnitPosition(Unit unit, double oldX, double oldY, double newX, double newY)
updateUnitPosition
in interface VisibilityFilter
unit
- Description of ParameteroldX
- Description of ParameteroldY
- Description of ParameternewX
- Description of ParameternewY
- Description of Parameterpublic void deleteUnit(Unit unit, double lastKnownX, double lastKnownY)
deleteUnit
in interface VisibilityFilter
unit
- Description of ParameterlastKnownX
- Description of ParameterlastKnownY
- Description of Parameterpublic void resendAllData(String role)
resendAllData
in interface VisibilityFilter
role
- Description of Parameterpublic void actionBlocked(Unit unit, ActionDefinition action, boolean isBlocked)
actionBlocked
in interface VisibilityFilter
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)
actionCompleted
in interface VisibilityFilter
action
- The action.wasSuccessful
- true if the action was successful, false
if it failed.public void unitPropertyChanged(Unit unit, String key, String newValue)
unitPropertyChanged
in interface VisibilityFilter
unit
- The unit whose property changed.key
- The property that has changed.newValue
- The new value of the property.public void actionRejected(String role, int actionHandle)
actionRejected
in interface VisibilityFilter
role
- The role.actionHandle
- The action handle.public void roleMessage(String role, Unit unit, String message)
roleMessage
in interface VisibilityFilter
role
- The role.unit
- The unit.message
- The message to be delivered.public void unitMessage(Unit unit, String message)
unitMessage
in interface VisibilityFilter
unit
- The unit.message
- The message to be delivered.public void abortAllActions(Unit unit)
VisibilityFilter
abortAllActions
in interface VisibilityFilter
public void timeUpdate(String time)
timeUpdate
in interface VisibilityFilter
time
- A String representing the current game time.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |