Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gecco.server.core
Interface Client

All Known Implementing Classes:
  ClientAmbassador

public interface Client

Description of the Interface

Author:
  Henrik Bäärnhielm and/or Henrik Hägerström

Method Summary
`void` | `abortAllActions(String role, int unitHandle)` Description of the Method
`void` | `actionCompleted(String role, int actionHandle)` Tells the clients that an action was successfully completed.
`void` | `actionFailed(String role, int actionHandle)` Tells the clients that an action has failed.
`void` | `automatonHasState(String role, int x, int y, Color color)` Tells the clients that an automaton, which may or may not have been visible to them previously, is now visible and in a certain state.
`void` | `automatonInvisible(String role, int x, int y)` Tells the clients that an automaton, which was previously visible to them, is now invisible.
`void` | `automatonsHasState(String role, List pointObjects, List colors)` Description of the Method
`void` | `automatonsInvisible(String role, List pointObjects)` Description of the Method
`void` | `coffeeBreak(String message)`
`void` | `gameOver(String winner)` Sends a GameOverMessage to all the clients.
`void` | `timeUpdate(String time)` Tells all clients that some game time has passed.
`void` | `unitActionBlocked(String role, int handle, ActionDefinition action, boolean isBlocked)` Tells the clients that an action of the specified unit, which was and is visible to them, is now blocked or unblocked (depending on `isBlocked` ).
`void` | `unitDeleted(String role, int handle)` Tells the clients that the specified unit, which was previosly visible to them, is now deleted.
`void` | `unitInvisible(String role, int handle)` Tells the clients that the specified unit, which was previosly visible to them, is now invisible.
`void` | `unitMessage(String role, int unitHandle, String unitMessage)` Description of the Method
`void` | `unitMoved(String role, int handle, double newX, double newY)` Tells the clients that the specified unit, which was and is visible to them, has moved.
`void` | `unitPropertyChanged(String role, int handle, String key, String newValue)` Tells the clients that a property of the specified unit, which was and is visible to them, has changed.
`void` | `unitVisible(String role, int handle, String name, String type, double x, double y, Set unblockedActions, Set blockedActions, Map properties)` Tells the clients that the specified unit, which was previously invisible to them, is now visible.

Method Detail

### unitVisible

    public void unitVisible(String role,
                            int handle,
                            String name,
                            String type,
                            double x,
                            double y,
                            Set unblockedActions,
                            Set blockedActions,
                            Map properties)

  Tells the clients that the specified unit, which was previously invisible to them, is now visible. Note that the sets of actions and properties should be censored, so that properties are not sent to clients that are not observers.

  Parameters:
    `role` - The message is to be sent only to the client(s) playing this role.
    `handle` - Specifies which unit the message is about.
    `name` - the name of this particular unit.
    `type` - the name of this kind of unit.
    `x` - the X coordinate of the unit.
    `y` - the Y coordinate of the unit.
    `unblockedActions` - the set containing `ActionDefinitions` for all actions that the specified client(s) may order this unit to perform, and that are currently not blocked. May be `null` if the clients can't give this unit any orders at all.
    `blockedActions` - the set containing `ActionDefinitions` for all actions that the specified client(s) may order this unit to perform, and that are currently blocked (such as, for example, the command "Move" when the unit has no fuel left). May be `null` if the set is empty.
    `properties` - the properties (key/value pairs) of this unit that the specified client(s) can see. May be `null` .

### unitInvisible

    public void unitInvisible(String role,
                              int handle)

  Tells the clients that the specified unit, which was previosly visible to them, is now invisible.

  Parameters:
    `role` - The message is to be sent only to the client(s) playing this role.
    `handle` - Specifies which unit the message is about.

### unitDeleted

    public void unitDeleted(String role,
                            int handle)

  Tells the clients that the specified unit, which was previosly visible to them, is now deleted.

  Parameters:
    `role` - The message is to be sent only to the client(s) playing this role.
    `handle` - Specifies which unit the message is about.

### unitMoved

    public void unitMoved(String role,
                          int handle,
                          double newX,
                          double newY)

  Tells the clients that the specified unit, which was and is visible to them, has moved.

  Parameters:
    `role` - The message is to be sent only to the client(s) playing this role.
    `handle` - Specifies which unit the message is about.
    `newX` - the new X coordinate of the unit.
    `newY` - the new Y coordinate of the unit.

### unitPropertyChanged

    public void unitPropertyChanged(String role,
                                    int handle,
                                    String key,
                                    String newValue)

  Tells the clients that a property of the specified unit, which was and is visible to them, has changed.

  Parameters:
    `role` - The message is to be sent only to the client(s) playing this role.
    `handle` - Specifies which unit the message is about.
    `key` - the property that has changed.
    `newValue` - the new value of the property.

### unitActionBlocked

    public void unitActionBlocked(String role,
                                  int handle,
                                  ActionDefinition action,
                                  boolean isBlocked)

  Tells the clients that an action of the specified unit, which was and is visible to them, is now blocked or unblocked (depending on `isBlocked` ).

  Parameters:
    `role` - The message is to be sent only to the client(s) playing this role.
    `handle` - Specifies which unit the message is about.
    `action` - the action that is now blocked or unblocked.
    `isBlocked` - Description of Parameter

### automatonHasState

    public void automatonHasState(String role,
                                  int x,
                                  int y,
                                  Color color)

  Tells the clients that an automaton, which may or may not have been visible to them previously, is now visible and in a certain state. This message is intended to serve two purposes: a) tell the clients about a state change in an automaton they can already see, or b) tell them that an automaton they could not previously see is now visible (in which case they get to know what state it's in).

  Parameters:
    `role` - The message is to be sent only to the client(s) playing this role.
    `x` - the X coordinate of the automaton.
    `y` - the Y coordinate of the automaton.
    `color` - the color representing the current state.

### automatonsHasState

    public void automatonsHasState(String role,
                                   List pointObjects,
                                   List colors)

  Description of the Method

  Parameters:
    `role` - Description of Parameter
    `pointObjects` - Description of Parameter
    `colors` - Description of Parameter

### automatonInvisible

    public void automatonInvisible(String role,
                                   int x,
                                   int y)

  Tells the clients that an automaton, which was previously visible to them, is now invisible.

  Parameters:
    `role` - The message is to be sent only to the client(s) playing this role.
    `x` - the X coordinate of the automaton.
    `y` - the Y coordinate of the automaton.

### automatonsInvisible

    public void automatonsInvisible(String role,
                                    List pointObjects)

  Description of the Method

  Parameters:
    `role` - Description of Parameter
    `pointObjects` - Description of Parameter

### actionCompleted

    public void actionCompleted(String role,
                                int actionHandle)

  Tells the clients that an action was successfully completed.

  Parameters:
    `role` - The message is to be sent only to the client(s) playing this role.
    `actionHandle` - The handle for the completed action.

### actionFailed

    public void actionFailed(String role,
                             int actionHandle)

  Tells the clients that an action has failed.

  Parameters:
    `role` - The message is to be sent only to the client(s) playing this role.
    `actionHandle` - The handle for the failed action.

### unitMessage

    public void unitMessage(String role,
                            int unitHandle,
                            String unitMessage)

  Description of the Method

  Parameters:
    `role` - Description of Parameter
    `unitHandle` - Description of Parameter
    `unitMessage` - Description of Parameter

### abortAllActions

    public void abortAllActions(String role,
                                int unitHandle)

  Description of the Method

  Parameters:
    `role` - Description of Parameter
    `unitHandle` - Description of Parameter

### gameOver

    public void gameOver(String winner)

  Sends a GameOverMessage to all the clients.

  Parameters:
    `winner` - a `String` value

### coffeeBreak

    public void coffeeBreak(String message)

### timeUpdate

    public void timeUpdate(String time)

  Tells all clients that some game time has passed.

  Parameters:
    `time` - A String representing the current time.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD